diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-06-29 13:50:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-06-29 13:50:21 -0700 |
commit | 72ad9f9d215397aa0ffacf88c5f7e020b856d47f (patch) | |
tree | a4348195ef42a252c989a41190bb01b01abe3f4b /drivers/pnp/core.c | |
parent | 5e6928249b81b4d8727ab6a4037a171d15455cb0 (diff) | |
parent | 17aa26c96fb240de92db90ec1bfd616f28b6dc16 (diff) | |
download | linux-72ad9f9d215397aa0ffacf88c5f7e020b856d47f.tar.bz2 |
Merge tag 'pnp-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull PNP updates from Rafael Wysocki:
"These get rid of unnecessary local variables and function, reduce code
duplication and clean up message printing.
Specifics:
- Remove unnecessary local variables from isapnp_proc_attach_device()
(Anupama K Patil).
- Make the callers of pnp_alloc() use kzalloc() directly and drop the
former (Heiner Kallweit).
- Make two pieces of code use dev_dbg() instead of dev_printk() with
the KERN_DEBUG message level (Heiner Kallweit).
- Use DEVICE_ATTR_RO() instead of full DEVICE_ATTR() in some places
in card.c (Zhen Lei).
- Use list_for_each_entry() instead of list_for_each() in
insert_device() (Zou Wei)"
* tag 'pnp-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PNP: pnpbios: Use list_for_each_entry() instead of list_for_each()
PNP: use DEVICE_ATTR_RO macro
PNP: Switch over to dev_dbg()
PNP: Remove pnp_alloc()
drivers: pnp: isapnp: proc.c: Remove unnecessary local variables
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r-- | drivers/pnp/core.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index a50ab002e9e4..4df5aa6a309c 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -31,18 +31,6 @@ DEFINE_MUTEX(pnp_lock); int pnp_platform_devices; EXPORT_SYMBOL(pnp_platform_devices); -void *pnp_alloc(long size) -{ - void *result; - - result = kzalloc(size, GFP_KERNEL); - if (!result) { - printk(KERN_ERR "pnp: Out of Memory\n"); - return NULL; - } - return result; -} - static void pnp_remove_protocol(struct pnp_protocol *protocol) { mutex_lock(&pnp_lock); @@ -227,9 +215,8 @@ int pnp_add_device(struct pnp_dev *dev) for (id = dev->id; id; id = id->next) len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id); - dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs%s (%s)\n", - dev->protocol->name, buf, - dev->active ? "active" : "disabled"); + dev_dbg(&dev->dev, "%s device, IDs%s (%s)\n", dev->protocol->name, buf, + dev->active ? "active" : "disabled"); return 0; } |