Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PNP: Remove prehistoric deadcode

pnp_remove_card() is currently unused, it has been since it was
added in 2003's BKrev: 3e6d3f19XSmESWEZnNEReEJOJW5SOw

pnp_unregister_protocol() is currently unused, it has been since
it was added in 2002's BKrev: 3df0cf6d4FVUKndhbfxjL7pksw5PGA

Remove them, and pnp_remove_card_device() and __pnp_remove_device()
which are now no longer used.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20250307214936.74504-1-linux@treblig.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Dr. David Alan Gilbert and committed by
Rafael J. Wysocki
270247a2 80e54e84

-55
-3
Documentation/admin-guide/pnp.rst
··· 129 129 pnp_register_protocol 130 130 use this to register a new PnP protocol 131 131 132 - pnp_unregister_protocol 133 - use this function to remove a PnP protocol from the Plug and Play Layer 134 - 135 132 pnp_register_driver 136 133 adds a PnP driver to the Plug and Play Layer 137 134
-4
drivers/pnp/base.h
··· 9 9 extern const struct bus_type pnp_bus_type; 10 10 11 11 int pnp_register_protocol(struct pnp_protocol *protocol); 12 - void pnp_unregister_protocol(struct pnp_protocol *protocol); 13 12 14 13 #define PNP_EISA_ID_MASK 0x7fffffff 15 14 void pnp_eisa_id_to_string(u32 id, char *str); ··· 20 21 struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id); 21 22 22 23 int pnp_add_card(struct pnp_card *card); 23 - void pnp_remove_card(struct pnp_card *card); 24 24 int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev); 25 - void pnp_remove_card_device(struct pnp_dev *dev); 26 25 27 26 struct pnp_port { 28 27 resource_size_t min; /* min base number */ ··· 135 138 void pnp_fixup_device(struct pnp_dev *dev); 136 139 void pnp_free_options(struct pnp_dev *dev); 137 140 int __pnp_add_device(struct pnp_dev *dev); 138 - void __pnp_remove_device(struct pnp_dev *dev); 139 141 140 142 int pnp_check_port(struct pnp_dev *dev, struct resource *res); 141 143 int pnp_check_mem(struct pnp_dev *dev, struct resource *res);
-32
drivers/pnp/card.c
··· 270 270 } 271 271 272 272 /** 273 - * pnp_remove_card - removes a PnP card from the PnP Layer 274 - * @card: pointer to the card to remove 275 - */ 276 - void pnp_remove_card(struct pnp_card *card) 277 - { 278 - struct list_head *pos, *temp; 279 - 280 - device_unregister(&card->dev); 281 - mutex_lock(&pnp_lock); 282 - list_del(&card->global_list); 283 - list_del(&card->protocol_list); 284 - mutex_unlock(&pnp_lock); 285 - list_for_each_safe(pos, temp, &card->devices) { 286 - struct pnp_dev *dev = card_to_pnp_dev(pos); 287 - pnp_remove_card_device(dev); 288 - } 289 - } 290 - 291 - /** 292 273 * pnp_add_card_device - adds a device to the specified card 293 274 * @card: pointer to the card to add to 294 275 * @dev: pointer to the device to add ··· 285 304 list_add_tail(&dev->card_list, &card->devices); 286 305 mutex_unlock(&pnp_lock); 287 306 return 0; 288 - } 289 - 290 - /** 291 - * pnp_remove_card_device- removes a device from the specified card 292 - * @dev: pointer to the device to remove 293 - */ 294 - void pnp_remove_card_device(struct pnp_dev *dev) 295 - { 296 - mutex_lock(&pnp_lock); 297 - dev->card = NULL; 298 - list_del(&dev->card_list); 299 - mutex_unlock(&pnp_lock); 300 - __pnp_remove_device(dev); 301 307 } 302 308 303 309 /**
-16
drivers/pnp/core.c
··· 78 78 return ret; 79 79 } 80 80 81 - /** 82 - * pnp_unregister_protocol - removes a pnp protocol from the pnp layer 83 - * @protocol: pointer to the corresponding pnp_protocol structure 84 - */ 85 - void pnp_unregister_protocol(struct pnp_protocol *protocol) 86 - { 87 - pnp_remove_protocol(protocol); 88 - device_unregister(&protocol->dev); 89 - } 90 - 91 81 static void pnp_free_ids(struct pnp_dev *dev) 92 82 { 93 83 struct pnp_id *id; ··· 208 218 dev_dbg(&dev->dev, "%s device, IDs%s (%s)\n", dev->protocol->name, buf, 209 219 dev->active ? "active" : "disabled"); 210 220 return 0; 211 - } 212 - 213 - void __pnp_remove_device(struct pnp_dev *dev) 214 - { 215 - pnp_delist_device(dev); 216 - device_unregister(&dev->dev); 217 221 } 218 222 219 223 static int __init pnp_init(void)