Skip to content

Commit 270247a

Browse files
Dr. David Alan Gilbertrafaeljw
authored andcommitted
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>
1 parent 80e54e8 commit 270247a

File tree

4 files changed

+0
-55
lines changed

4 files changed

+0
-55
lines changed

Documentation/admin-guide/pnp.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ pnp_put_protocol
129129
pnp_register_protocol
130130
use this to register a new PnP protocol
131131

132-
pnp_unregister_protocol
133-
use this function to remove a PnP protocol from the Plug and Play Layer
134-
135132
pnp_register_driver
136133
adds a PnP driver to the Plug and Play Layer
137134

drivers/pnp/base.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ extern const struct attribute_group *pnp_dev_groups[];
99
extern const struct bus_type pnp_bus_type;
1010

1111
int pnp_register_protocol(struct pnp_protocol *protocol);
12-
void pnp_unregister_protocol(struct pnp_protocol *protocol);
1312

1413
#define PNP_EISA_ID_MASK 0x7fffffff
1514
void pnp_eisa_id_to_string(u32 id, char *str);
@@ -21,9 +20,7 @@ int pnp_add_device(struct pnp_dev *dev);
2120
struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id);
2221

2322
int pnp_add_card(struct pnp_card *card);
24-
void pnp_remove_card(struct pnp_card *card);
2523
int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
26-
void pnp_remove_card_device(struct pnp_dev *dev);
2724

2825
struct pnp_port {
2926
resource_size_t min; /* min base number */
@@ -138,7 +135,6 @@ void pnp_init_resources(struct pnp_dev *dev);
138135
void pnp_fixup_device(struct pnp_dev *dev);
139136
void pnp_free_options(struct pnp_dev *dev);
140137
int __pnp_add_device(struct pnp_dev *dev);
141-
void __pnp_remove_device(struct pnp_dev *dev);
142138

143139
int pnp_check_port(struct pnp_dev *dev, struct resource *res);
144140
int pnp_check_mem(struct pnp_dev *dev, struct resource *res);

drivers/pnp/card.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -269,25 +269,6 @@ int pnp_add_card(struct pnp_card *card)
269269
return 0;
270270
}
271271

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-
291272
/**
292273
* pnp_add_card_device - adds a device to the specified card
293274
* @card: pointer to the card to add to
@@ -306,19 +287,6 @@ int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev)
306287
return 0;
307288
}
308289

309-
/**
310-
* pnp_remove_card_device- removes a device from the specified card
311-
* @dev: pointer to the device to remove
312-
*/
313-
void pnp_remove_card_device(struct pnp_dev *dev)
314-
{
315-
mutex_lock(&pnp_lock);
316-
dev->card = NULL;
317-
list_del(&dev->card_list);
318-
mutex_unlock(&pnp_lock);
319-
__pnp_remove_device(dev);
320-
}
321-
322290
/**
323291
* pnp_request_card_device - Searches for a PnP device under the specified card
324292
* @clink: pointer to the card link, cannot be NULL

drivers/pnp/core.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol)
7878
return ret;
7979
}
8080

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-
9181
static void pnp_free_ids(struct pnp_dev *dev)
9282
{
9383
struct pnp_id *id;
@@ -220,12 +210,6 @@ int pnp_add_device(struct pnp_dev *dev)
220210
return 0;
221211
}
222212

223-
void __pnp_remove_device(struct pnp_dev *dev)
224-
{
225-
pnp_delist_device(dev);
226-
device_unregister(&dev->dev);
227-
}
228-
229213
static int __init pnp_init(void)
230214
{
231215
return bus_register(&pnp_bus_type);

0 commit comments

Comments
 (0)