Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/base/core.c |
static int device_add_attrs(struct device *dev) {
struct class *class = dev->class;
const struct device_type *type = dev->type;
int error;
if (class) {
error = device_add_groups(dev, class->dev_groups);
if (error)
return error;
}
if (type) {
error = device_add_groups(dev, type->groups);... | [
0,
0
] |
Linux Kernel | drivers/base/core.c | static void devices_kset_move_before(struct device *deva, struct device *devb) {
if (!devices_kset)
return;
pr_debug("devices_kset: Moving %s before %s\n", dev_name(deva),
dev_name(devb));
spin_lock(&devices_kset->list_lock);
list_move_tail(&deva->kobj.entry, &devb->kobj.entry);
spin_unlock(&de... | [
0,
0
] |
Linux Kernel | drivers/base/core.c | void device_remove_file(struct device *dev,
const struct device_attribute *attr) {
if (dev)
sysfs_remove_file(&dev->kobj, &attr->attr);
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c |
struct kobject *virtual_device_parent(struct device *dev) {
static struct kobject *virtual_dir = NULL;
if (!virtual_dir)
virtual_dir = kobject_create_and_add("virtual", &devices_kset->kobj);
return virtual_dir;
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c |
static const struct kobj_ns_type_operations *
class_dir_child_ns_type(struct kobject *kobj) {
struct class_dir *dir = to_class_dir(kobj);
return dir->class->ns_type;
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c | static struct kobject *get_device_parent(struct device *dev,
struct device *parent) {
if (dev->class) {
struct kobject *kobj = NULL;
struct kobject *parent_kobj;
struct kobject *k;
#ifdef CONFIG_BLOCK
if (sysfs_deprecated && dev->class == &block_class) {
... | [
1,
0
] |
Linux Kernel | drivers/base/core.c |
static inline bool live_in_glue_dir(struct kobject *kobj, struct device *dev) {
if (!kobj || !dev->class || kobj->kset != &dev->class->p->glue_dirs)
return false;
return true;
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c | static inline bool kobject_has_children(struct kobject *kobj) {
WARN_ON_ONCE(kref_read(&kobj->kref) == 0);
return kobj->sd && kobj->sd->dir.subdirs;
} | [
1,
0
] |
Linux Kernel | drivers/base/core.c |
static void device_remove_class_symlinks(struct device *dev) {
if (dev_of_node(dev))
sysfs_remove_link(&dev->kobj, "of_node");
if (!dev->class)
return;
if (dev->parent && device_is_not_partition(dev))
sysfs_remove_link(&dev->kobj, "device");
sysfs_remove_link(&dev->kobj, "subsystem");
#ifdef CONF... | [
0,
0
] |
Linux Kernel | drivers/base/core.c | int device_register(struct device *dev) {
device_initialize(dev);
return device_add(dev);
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c | void device_del(struct device *dev) {
struct device *parent = dev->parent;
struct kobject *glue_dir = NULL;
struct class_interface *class_intf;
unsigned int noio_flag;
device_lock(dev);
kill_device(dev);
device_unlock(dev);
if (dev->fwnode && dev->fwnode->dev == dev)
dev->fwnode->dev = NULL;
no... | [
1,
0
] |
Linux Kernel | drivers/base/core.c | void device_unregister(struct device *dev) {
pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
device_del(dev);
put_device(dev);
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c | struct device *__root_device_register(const char *name, struct module *owner) {
struct root_device *root;
int err = -ENOMEM;
root = kzalloc(sizeof(struct root_device), GFP_KERNEL);
if (!root)
return ERR_PTR(err);
err = dev_set_name(&root->dev, "%s", name);
if (err) {
kfree(root);
return ERR_PT... | [
0,
0
] |
Linux Kernel | drivers/base/core.c |
static void device_create_release(struct device *dev) {
pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
kfree(dev);
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c | struct device *device_create_with_groups(struct class *class,
struct device *parent, dev_t devt,
void *drvdata,
const struct attribute_group **groups,
const... | [
0,
0
] |
Linux Kernel | drivers/base/core.c |
static void __dev_printk(const char *level, const struct device *dev,
struct va_format *vaf) {
if (dev)
dev_printk_emit(level[1] - '0', dev, "%s %s: %pV", dev_driver_string(dev),
dev_name(dev), vaf);
else
printk("%s(NULL device *): %pV", level, vaf);
} | [
1,
0
] |
Linux Kernel | drivers/base/core.c | int dev_err_probe(const struct device *dev, int err, const char *fmt, ...) {
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
if (err != -EPROBE_DEFER) {
dev_err(dev, "error %pe: %pV", ERR_PTR(err), &vaf);
} else {
device_set_deferred_probe_reason(dev, &vaf... | [
1,
0
] |
Linux Kernel | drivers/base/core.c | void device_set_of_node_from_dev(struct device *dev,
const struct device *dev2) {
of_node_put(dev->of_node);
dev->of_node = of_node_get(dev2->of_node);
dev->of_node_reused = true;
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c |
int device_match_of_node(struct device *dev, const void *np) {
return dev->of_node == np;
} | [
0,
0
] |
Linux Kernel | drivers/base/core.c |
int device_match_acpi_dev(struct device *dev, const void *adev) {
return ACPI_COMPANION(dev) == adev;
} | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c | static int cpu_subsys_online(struct device *dev) {
struct cpu *cpu = container_of(dev, struct cpu, dev);
int cpuid = dev->id;
int from_nid, to_nid;
int ret;
from_nid = cpu_to_node(cpuid);
if (from_nid == NUMA_NO_NODE)
return -ENODEV;
ret = cpu_device_up(dev);
to_nid = cpu_to_node(cpuid);
if (fr... | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
static int cpu_subsys_offline(struct device *dev) {
return cpu_device_down(dev);
} | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
static ssize_t cpu_release_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count) {
ssize_t cnt;
int ret;
ret = lock_device_hotplug_sysfs();
if (ret)
return ret;
cnt = arch_cpu_release(buf, count);
unl... | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c | static ssize_t crash_notes_show(struct device *dev,
struct device_attribute *attr, char *buf) {
struct cpu *cpu = container_of(dev, struct cpu, dev);
unsigned long long addr;
int cpunum;
cpunum = cpu->dev.id;
addr = per_cpu_ptr_to_phys(per_cpu_ptr(crash_notes, cpunum));
re... | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
static void device_create_release(struct device *dev) { kfree(dev); } | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c | static struct device *__cpu_device_create(struct device *parent, void *drvdata,
const struct attribute_group **groups,
const char *fmt, va_list args) {
struct device *dev = NULL;
int retval = -ENOMEM;
dev = kzalloc(sizeof(*dev), ... | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
ssize_t __weak cpu_show_spectre_v2(struct device *dev,
struct device_attribute *attr, char *buf) {
return sysfs_emit(buf, "Not affected\n");
} | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
ssize_t __weak cpu_show_spec_store_bypass(struct device *dev,
struct device_attribute *attr,
char *buf) {
return sysfs_emit(buf, "Not affected\n");
} | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
ssize_t __weak cpu_show_l1tf(struct device *dev, struct device_attribute *attr,
char *buf) {
return sysfs_emit(buf, "Not affected\n");
} | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
ssize_t __weak cpu_show_mds(struct device *dev, struct device_attribute *attr,
char *buf) {
return sysfs_emit(buf, "Not affected\n");
} | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c | static inline void cpu_register_vulnerabilities(void) {}
#endif | [
0,
0
] |
Linux Kernel | drivers/base/cpu.c |
void __init cpu_dev_init(void) {
if (subsys_system_register(&cpu_subsys, cpu_root_attr_groups))
panic("Failed to register CPU subsystem");
cpu_dev_register_generic();
cpu_register_vulnerabilities();
} | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | static void deferred_probe_work_func(struct work_struct *work) {
struct device *dev;
struct device_private *private;
mutex_lock(&deferred_probe_mutex);
while (!list_empty(&deferred_probe_active_list)) {
private = list_first_entry(&deferred_probe_active_list, typeof(*dev->p),
... | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | void driver_deferred_probe_trigger(void) {
if (!driver_deferred_probe_enable)
return;
mutex_lock(&deferred_probe_mutex);
atomic_inc(&deferred_trigger_count);
list_splice_tail_init(&deferred_probe_pending_list,
&deferred_probe_active_list);
mutex_unlock(&deferred_probe_mutex);
/... | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | void device_set_deferred_probe_reason(const struct device *dev,
struct va_format *vaf) {
const char *drv = dev_driver_string(dev);
char *reason;
mutex_lock(&deferred_probe_mutex);
reason = kasprintf(GFP_KERNEL, "%s: %pV", drv, vaf);
__device_set_deferred_probe_reason(de... | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | static int deferred_devs_show(struct seq_file *s, void *data) {
struct device_private *curr;
mutex_lock(&deferred_probe_mutex);
list_for_each_entry(curr, &deferred_probe_pending_list, deferred_probe)
seq_printf(s, "%s\t%s", dev_name(curr->device),
curr->device->p->deferred_probe_reason ?:... | [
0,
0
] |
Linux Kernel | drivers/base/dd.c |
static int __init deferred_probe_timeout_setup(char *str) {
int timeout;
if (!kstrtoint(str, 10, &timeout))
driver_deferred_probe_timeout = timeout;
return 1;
} | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | int driver_deferred_probe_check_state(struct device *dev) {
if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) {
dev_warn(dev, "ignoring dependency for device, assuming no driver\n");
return -ENODEV;
}
if (!driver_deferred_probe_timeout && initcalls_done) {
dev_warn(dev, "deferred probe timeout, igno... | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | static int deferred_probe_initcall(void) {
debugfs_create_file("devices_deferred", 0444, NULL, NULL,
&deferred_devs_fops);
driver_deferred_probe_enable = true;
driver_deferred_probe_trigger();
flush_work(&deferred_probe_work);
initcalls_done = true;
if (!IS_ENABLED(CONFIG_MODULES))
... | [
0,
0
] |
Linux Kernel | drivers/base/dd.c |
static int driver_sysfs_add(struct device *dev) {
int ret;
if (dev->bus)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
BUS_NOTIFY_BIND_DRIVER, dev);
ret = sysfs_create_link(&dev->driver->p->kobj, &dev->kobj,
kobject_name(&dev->kobj));
... | [
1,
0
] |
Linux Kernel | drivers/base/dd.c |
static int __driver_probe_device(struct device_driver *drv,
struct device *dev) {
int ret = 0;
if (dev->p->dead || !device_is_registered(dev))
return -ENODEV;
if (dev->driver)
return -EBUSY;
dev->can_match = true;
pr_debug("bus: '%s': %s: matched device %s with driv... | [
1,
0
] |
Linux Kernel | drivers/base/dd.c |
static inline bool cmdline_requested_async_probing(const char *drv_name) {
bool async_drv;
async_drv = parse_option_str(async_probe_drv_names, drv_name);
return (async_probe_default != async_drv);
} | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | int device_attach(struct device *dev) { return __device_attach(dev, false); } | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | static void __device_driver_lock(struct device *dev, struct device *parent) {
if (parent && dev->bus->need_parent_lock)
device_lock(parent);
device_lock(dev);
} | [
1,
0
] |
Linux Kernel | drivers/base/dd.c | static void __device_driver_unlock(struct device *dev, struct device *parent) {
device_unlock(dev);
if (parent && dev->bus->need_parent_lock)
device_unlock(parent);
} | [
1,
0
] |
Linux Kernel | drivers/base/dd.c |
static void __driver_attach_async_helper(void *_dev, async_cookie_t cookie) {
struct device *dev = _dev;
struct device_driver *drv;
int ret;
__device_driver_lock(dev, dev->parent);
drv = dev->p->async_driver;
dev->p->async_driver = NULL;
ret = driver_probe_device(drv, dev);
__device_driver_unlock(dev,... | [
0,
0
] |
Linux Kernel | drivers/base/dd.c | static int __driver_attach(struct device *dev, void *data) {
struct device_driver *drv = data;
bool async = false;
int ret;
ret = driver_match_device(drv, dev);
if (ret == 0) {
/* no match */
return 0;
} else if (ret == -EPROBE_DEFER) {
dev_dbg(dev, "Device match requests probe deferral\n");
... | [
1,
0
] |
Linux Kernel | drivers/base/dd.c | static void __device_release_driver(struct device *dev, struct device *parent) {
struct device_driver *drv;
drv = dev->driver;
if (drv) {
pm_runtime_get_sync(dev);
while (device_links_busy(dev)) {
__device_driver_unlock(dev, parent);
device_links_unbind_consumers(dev);
__device_drive... | [
1,
0
] |
Linux Kernel | drivers/base/dd.c | void device_driver_detach(struct device *dev) {
device_release_driver_internal(dev, NULL, dev->parent);
} | [
0,
0
] |
Linux Kernel | drivers/base/devcoredump.c | static void devcd_dev_release(struct device *dev) {
struct devcd_entry *devcd = dev_to_devcd(dev);
devcd->free(devcd->data);
module_put(devcd->owner);
if (devcd->failing_dev->kobj.sd)
sysfs_delete_link(&devcd->failing_dev->kobj, &dev->kobj, "devcoredump");
put_device(devcd->failing_dev);
kfree(devcd)... | [
0,
0
] |
Linux Kernel | drivers/base/devcoredump.c |
static void devcd_del(struct work_struct *wk) {
struct devcd_entry *devcd;
devcd = container_of(wk, struct devcd_entry, del_wk.work);
device_del(&devcd->devcd_dev);
put_device(&devcd->devcd_dev);
} | [
0,
0
] |
Linux Kernel | drivers/base/devcoredump.c |
static int devcd_free(struct device *dev, void *data) {
struct devcd_entry *devcd = dev_to_devcd(dev);
mutex_lock(&devcd->mutex);
if (!devcd->delete_work)
devcd->delete_work = true;
flush_delayed_work(&devcd->del_wk);
mutex_unlock(&devcd->mutex);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/base/devcoredump.c | static ssize_t devcd_read_from_sgtable(char *buffer, loff_t offset,
size_t buf_len, void *data,
size_t data_len) {
struct scatterlist *table = data;
if (offset > data_len)
return -EINVAL;
if (offset + buf_len > data_len)
buf_l... | [
0,
0
] |
Linux Kernel | drivers/base/devcoredump.c |
static void __exit devcoredump_exit(void) {
class_for_each_device(&devcd_class, NULL, NULL, devcd_free);
class_unregister(&devcd_class);
} | [
0,
0
] |
Linux Kernel | drivers/base/devres.c |
static void devres_dbg(struct device *dev, struct devres_node *node,
const char *op) {
if (unlikely(log_devres))
dev_err(dev, "DEVRES %3s %p %s (%zu bytes)\n", op, node, node->name,
node->size);
} | [
0,
0
] |
Linux Kernel | drivers/base/devres.c |
static void replace_dr(struct device *dev, struct devres_node *old,
struct devres_node *new) {
devres_log(dev, old, "REPLACE");
BUG_ON(!list_empty(&new->entry));
list_replace(&old->entry, &new->entry);
} | [
0,
0
] |
Linux Kernel | drivers/base/devres.c | void devres_for_each_res(struct device *dev, dr_release_t release,
dr_match_t match, void *match_data,
void (*fn)(struct device *, void *, void *),
void *data) {
struct devres_node *node;
struct devres_node *tmp;
unsigned long flags;
if... | [
0,
0
] |
Linux Kernel | drivers/base/devres.c | void *devres_remove(struct device *dev, dr_release_t release, dr_match_t match,
void *match_data) {
struct devres *dr;
unsigned long flags;
spin_lock_irqsave(&dev->devres_lock, flags);
dr = find_dr(dev, release, match, match_data);
if (dr) {
list_del_init(&dr->node.entry);
devres_... | [
0,
0
] |
Linux Kernel | drivers/base/devres.c | static int remove_nodes(struct device *dev, struct list_head *first,
struct list_head *end, struct list_head *todo) {
struct devres_node *node, *n;
int cnt = 0, nr_groups = 0;
/* First pass - move normal devres entries to @todo and clear
* devres_group colors.
*/
node = list_entry... | [
1,
1
] |
Linux Kernel | drivers/base/devres.c | void *devres_open_group(struct device *dev, void *id, gfp_t gfp) {
struct devres_group *grp;
unsigned long flags;
grp = kmalloc(sizeof(*grp), gfp);
if (unlikely(!grp))
return NULL;
grp->node[0].release = &group_open_release;
grp->node[1].release = &group_close_release;
INIT_LIST_HEAD(&grp->node[0].e... | [
0,
0
] |
Linux Kernel | drivers/base/devres.c | const char *devm_kstrdup_const(struct device *dev, const char *s, gfp_t gfp) {
if (is_kernel_rodata((unsigned long)s))
return s;
return devm_kstrdup(dev, s, gfp);
} | [
0,
0
] |
Linux Kernel | drivers/base/devres.c | void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp) {
void *p;
p = devm_kmalloc(dev, len, gfp);
if (p)
memcpy(p, src, len);
return p;
} | [
1,
0
] |
Linux Kernel | drivers/base/devres.c | void devm_free_percpu(struct device *dev, void __percpu *pdata) {
WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match,
(__force void *)pdata));
} | [
0,
0
] |
Linux Kernel | drivers/base/devtmpfs.c |
static int __init mount_param(char *str) {
mount_dev = simple_strtoul(str, NULL, 0);
return 1;
} | [
0,
0
] |
Linux Kernel | drivers/base/devtmpfs.c | static inline int is_blockdev(struct device *dev) { return 0; }
#endif | [
0,
0
] |
Linux Kernel | drivers/base/devtmpfs.c |
static int devtmpfs_submit_req(struct req *req, const char *tmp) {
init_completion(&req->done);
spin_lock(&req_lock);
req->next = requests;
requests = req;
spin_unlock(&req_lock);
wake_up_process(thread);
wait_for_completion(&req->done);
kfree(tmp);
return req->err;
} | [
0,
0
] |
Linux Kernel | drivers/base/devtmpfs.c |
static int dev_rmdir(const char *name) {
struct path parent;
struct dentry *dentry;
int err;
dentry = kern_path_locked(name, &parent);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
if (d_really_is_positive(dentry)) {
if (d_inode(dentry)->i_private == &thread)
err = vfs_rmdir(&init_user_ns, d_i... | [
0,
0
] |
Linux Kernel | drivers/base/devtmpfs.c | int __init devtmpfs_mount(void) {
int err;
if (!mount_dev)
return 0;
if (!thread)
return 0;
err = init_mount("devtmpfs", "dev", "devtmpfs", DEVTMPFS_MFLAGS, NULL);
if (err)
printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
else
printk(KERN_INFO "devtmpfs: mounted\n");
return err;
... | [
0,
0
] |
Linux Kernel | drivers/base/driver.c | int driver_for_each_device(struct device_driver *drv, struct device *start,
void *data, int (*fn)(struct device *, void *)) {
struct klist_iter i;
struct device *dev;
int error = 0;
if (!drv)
return -EINVAL;
klist_iter_init_node(&drv->p->klist_devices, &i,
... | [
0,
0
] |
Linux Kernel | drivers/base/driver.c | struct device *driver_find_device(struct device_driver *drv,
struct device *start, const void *data,
int (*match)(struct device *dev,
const void *data)) {
struct klist_iter i;
struct device *dev;
if... | [
0,
0
] |
Linux Kernel | drivers/base/driver.c | struct device_driver *driver_find(const char *name, struct bus_type *bus) {
struct kobject *k = kset_find_obj(bus->p->drivers_kset, name);
struct driver_private *priv;
if (k) {
kobject_put(k);
priv = to_driver(k);
return priv->driver;
}
return NULL;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/builtin/main.c |
static bool fw_copy_to_prealloc_buf(struct firmware *fw, void *buf,
size_t size) {
if (!buf)
return true;
if (size < fw->size)
return false;
memcpy(buf, fw->data, fw->size);
return true;
} | [
1,
0
] |
Linux Kernel | drivers/base/firmware_loader/fallback.c | void fw_fallback_set_cache_timeout(void) {
fw_fallback_config.old_timeout = __firmware_loading_timeout();
__fw_fallback_set_timeout(10);
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/fallback.c |
static bool fw_force_sysfs_fallback(u32 opt_flags) {
if (fw_fallback_config.force_sysfs_fallback)
return true;
if (!(opt_flags & FW_OPT_USERHELPER))
return false;
return true;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/fallback_table.c | int register_firmware_config_sysctl(void) {
firmware_config_sysct_table_header =
register_sysctl("kernel/firmware_config", firmware_config_table);
if (!firmware_config_sysct_table_header)
return -ENOMEM;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/fallback_table.c |
void unregister_firmware_config_sysctl(void) {
unregister_sysctl_table(firmware_config_sysct_table_header);
firmware_config_sysct_table_header = NULL;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/firmware.h |
static inline bool __fw_state_check(struct fw_priv *fw_priv,
enum fw_status status) {
struct fw_state *fw_st = &fw_priv->fw_st;
return fw_st->status == status;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/firmware.h | static inline bool firmware_is_builtin(const struct firmware *fw) {
return false;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | int alloc_lookup_fw_priv(const char *fw_name, struct firmware_cache *fwc,
struct fw_priv **fw_priv, void *dbuf, size_t size,
size_t offset, u32 opt_flags) {
struct fw_priv *tmp;
spin_lock(&fwc->lock);
if (!(opt_flags & (FW_OPT_NOCACHE | FW_OPT_PARTIAL))) {
t... | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c |
void free_fw_priv(struct fw_priv *fw_priv) {
struct firmware_cache *fwc = fw_priv->fwc;
spin_lock(&fwc->lock);
if (!kref_put(&fw_priv->ref, __free_fw_priv))
spin_unlock(&fwc->lock);
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c |
void fw_free_paged_buf(struct fw_priv *fw_priv) {
int i;
if (!fw_priv->pages)
return;
vunmap(fw_priv->data);
for (i = 0; i < fw_priv->nr_pages; i++)
__free_page(fw_priv->pages[i]);
kvfree(fw_priv->pages);
fw_priv->pages = NULL;
fw_priv->page_array_size = 0;
fw_priv->nr_pages = 0;
fw_priv->... | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | static int fw_decompress_xz_pages(struct device *dev, struct fw_priv *fw_priv,
size_t in_size, const void *in_buffer) {
struct xz_dec *xz_dec;
struct xz_buf xz_buf;
enum xz_ret xz_ret;
struct page *page;
int err = 0;
xz_dec = xz_dec_init(XZ_DYNALLOC, (u32)-1);
if (!xz_de... | [
1,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | int request_firmware(const struct firmware **firmware_p, const char *name,
struct device *device) {
int ret;
__module_get(THIS_MODULE);
ret = _request_firmware(firmware_p, name, device, NULL, 0, 0, FW_OPT_UEVENT);
module_put(THIS_MODULE);
return ret;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | int firmware_request_platform(const struct firmware **firmware,
const char *name, struct device *device) {
int ret;
__module_get(THIS_MODULE);
ret = _request_firmware(firmware, name, device, NULL, 0, 0,
FW_OPT_UEVENT | FW_OPT_FALLBACK_PLATFORM);
module_pu... | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | int firmware_request_cache(struct device *device, const char *name) {
int ret;
mutex_lock(&fw_lock);
ret = fw_add_devm_name(device, name);
mutex_unlock(&fw_lock);
return ret;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | void release_firmware(const struct firmware *fw) {
if (fw) {
if (!firmware_is_builtin(fw))
firmware_free_data(fw);
kfree(fw);
}
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c |
static struct fw_priv *lookup_fw_priv(const char *fw_name) {
struct fw_priv *tmp;
struct firmware_cache *fwc = &fw_cache;
spin_lock(&fwc->lock);
tmp = __lookup_fw_priv(fw_name);
spin_unlock(&fwc->lock);
return tmp;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c |
static struct fw_cache_entry *alloc_fw_cache_entry(const char *name) {
struct fw_cache_entry *fce;
fce = kzalloc(sizeof(*fce), GFP_ATOMIC);
if (!fce)
goto exit;
fce->name = kstrdup_const(name, GFP_ATOMIC);
if (!fce->name) {
kfree(fce);
fce = NULL;
goto exit;
}
exit:
return fce;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c |
static int devm_name_match(struct device *dev, void *res, void *match_data) {
struct fw_name_devm *fwn = res;
return (fwn->magic == (unsigned long)match_data);
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c |
static void device_uncache_fw_images_work(struct work_struct *work) {
device_uncache_fw_images();
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | static void device_uncache_fw_images_delay(unsigned long delay) {
queue_delayed_work(system_power_efficient_wq, &fw_cache.work,
msecs_to_jiffies(delay));
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | static int fw_pm_notify(struct notifier_block *notify_block, unsigned long mode,
void *unused) {
switch (mode) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
case PM_RESTORE_PREPARE:
kill_pending_fw_fallback_reqs(true);
device_cache_fw_images();
break;
case PM_PO... | [
1,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c |
static inline void unregister_fw_pm_ops(void) {
unregister_syscore_ops(&fw_syscore_ops);
unregister_pm_notifier(&fw_cache.pm_notify);
}
#else | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv) {} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/main.c | static int fw_shutdown_notify(struct notifier_block *unused1,
unsigned long unused2, void *unused3) {
kill_pending_fw_fallback_reqs(false);
return NOTIFY_DONE;
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/sysfs.c | static ssize_t timeout_store(struct class *class, struct class_attribute *attr,
const char *buf, size_t count) {
int tmp_loading_timeout = simple_strtol(buf, NULL, 10);
if (tmp_loading_timeout < 0)
tmp_loading_timeout = 0;
__fw_fallback_set_timeout(tmp_loading_timeout);
retur... | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/sysfs.c |
static void fw_dev_release(struct device *dev) {
struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev);
if (fw_sysfs->fw_upload_priv)
fw_upload_free(fw_sysfs);
kfree(fw_sysfs);
} | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/sysfs.c | static ssize_t firmware_data_write(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buffer,
loff_t offset, size_t count) {
struct device *dev = kobj_to_dev(kobj);
struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev);
struc... | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/sysfs.h | static inline int register_sysfs_loader(void) { return 0; } | [
0,
0
] |
Linux Kernel | drivers/base/firmware_loader/sysfs.h |
static inline void fw_load_abort(struct fw_sysfs *fw_sysfs) {
struct fw_priv *fw_priv = fw_sysfs->fw_priv;
__fw_load_abort(fw_priv);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.