mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
pnp: struct device - replace bus_id with dev_name(), dev_set_name()
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
ba88b0029f
commit
c85e37c51e
3 changed files with 6 additions and 8 deletions
|
@ -165,8 +165,7 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *protocol, int id, char *pnp
|
||||||
card->number = id;
|
card->number = id;
|
||||||
|
|
||||||
card->dev.parent = &card->protocol->dev;
|
card->dev.parent = &card->protocol->dev;
|
||||||
sprintf(card->dev.bus_id, "%02x:%02x", card->protocol->number,
|
dev_set_name(&card->dev, "%02x:%02x", card->protocol->number, card->number);
|
||||||
card->number);
|
|
||||||
|
|
||||||
card->dev.coherent_dma_mask = DMA_24BIT_MASK;
|
card->dev.coherent_dma_mask = DMA_24BIT_MASK;
|
||||||
card->dev.dma_mask = &card->dev.coherent_dma_mask;
|
card->dev.dma_mask = &card->dev.coherent_dma_mask;
|
||||||
|
@ -295,8 +294,8 @@ int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev)
|
||||||
{
|
{
|
||||||
dev->dev.parent = &card->dev;
|
dev->dev.parent = &card->dev;
|
||||||
dev->card_link = NULL;
|
dev->card_link = NULL;
|
||||||
snprintf(dev->dev.bus_id, BUS_ID_SIZE, "%02x:%02x.%02x",
|
dev_set_name(&dev->dev, "%02x:%02x.%02x",
|
||||||
dev->protocol->number, card->number, dev->number);
|
dev->protocol->number, card->number, dev->number);
|
||||||
spin_lock(&pnp_lock);
|
spin_lock(&pnp_lock);
|
||||||
dev->card = card;
|
dev->card = card;
|
||||||
list_add_tail(&dev->card_list, &card->devices);
|
list_add_tail(&dev->card_list, &card->devices);
|
||||||
|
|
|
@ -70,7 +70,7 @@ int pnp_register_protocol(struct pnp_protocol *protocol)
|
||||||
spin_unlock(&pnp_lock);
|
spin_unlock(&pnp_lock);
|
||||||
|
|
||||||
protocol->number = nodenum;
|
protocol->number = nodenum;
|
||||||
sprintf(protocol->dev.bus_id, "pnp%d", nodenum);
|
dev_set_name(&protocol->dev, "pnp%d", nodenum);
|
||||||
return device_register(&protocol->dev);
|
return device_register(&protocol->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,8 +145,7 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid
|
||||||
dev->dev.coherent_dma_mask = dev->dma_mask;
|
dev->dev.coherent_dma_mask = dev->dma_mask;
|
||||||
dev->dev.release = &pnp_release_device;
|
dev->dev.release = &pnp_release_device;
|
||||||
|
|
||||||
sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
|
dev_set_name(&dev->dev, "%02x:%02x", dev->protocol->number, dev->number);
|
||||||
dev->number);
|
|
||||||
|
|
||||||
dev_id = pnp_add_id(dev, pnpid);
|
dev_id = pnp_add_id(dev, pnpid);
|
||||||
if (!dev_id) {
|
if (!dev_id) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ static void reserve_range(struct pnp_dev *dev, resource_size_t start,
|
||||||
resource_size_t end, int port)
|
resource_size_t end, int port)
|
||||||
{
|
{
|
||||||
char *regionid;
|
char *regionid;
|
||||||
const char *pnpid = dev->dev.bus_id;
|
const char *pnpid = dev_name(&dev->dev);
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
|
||||||
regionid = kmalloc(16, GFP_KERNEL);
|
regionid = kmalloc(16, GFP_KERNEL);
|
||||||
|
|
Loading…
Reference in a new issue