mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
memstick: struct device - replace bus_id with dev_name(), dev_set_name()
Cc: Alex Dubov <oakad@yahoo.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
1bb5beb49f
commit
0252c3b4f0
3 changed files with 11 additions and 12 deletions
|
@ -385,8 +385,7 @@ static struct memstick_dev *memstick_alloc_card(struct memstick_host *host)
|
||||||
|
|
||||||
if (card) {
|
if (card) {
|
||||||
card->host = host;
|
card->host = host;
|
||||||
snprintf(card->dev.bus_id, sizeof(card->dev.bus_id),
|
dev_set_name(&card->dev, "%s", dev_name(&host->dev));
|
||||||
"%s", host->dev.bus_id);
|
|
||||||
card->dev.parent = &host->dev;
|
card->dev.parent = &host->dev;
|
||||||
card->dev.bus = &memstick_bus_type;
|
card->dev.bus = &memstick_bus_type;
|
||||||
card->dev.release = memstick_free_card;
|
card->dev.release = memstick_free_card;
|
||||||
|
@ -519,7 +518,7 @@ int memstick_add_host(struct memstick_host *host)
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
snprintf(host->dev.bus_id, BUS_ID_SIZE, "memstick%u", host->id);
|
dev_set_name(&host->dev, "memstick%u", host->id);
|
||||||
|
|
||||||
rc = device_add(&host->dev);
|
rc = device_add(&host->dev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
|
|
@ -887,14 +887,14 @@ try_again:
|
||||||
if (rc) {
|
if (rc) {
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"%s: could not switch to 4-bit mode, error %d\n",
|
"%s: could not switch to 4-bit mode, error %d\n",
|
||||||
card->dev.bus_id, rc);
|
dev_name(&card->dev), rc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
msb->system = MEMSTICK_SYS_PAR4;
|
msb->system = MEMSTICK_SYS_PAR4;
|
||||||
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_PAR4);
|
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_PAR4);
|
||||||
printk(KERN_INFO "%s: switching to 4-bit parallel mode\n",
|
printk(KERN_INFO "%s: switching to 4-bit parallel mode\n",
|
||||||
card->dev.bus_id);
|
dev_name(&card->dev));
|
||||||
|
|
||||||
if (msb->caps & MEMSTICK_CAP_PAR8) {
|
if (msb->caps & MEMSTICK_CAP_PAR8) {
|
||||||
rc = mspro_block_set_interface(card, MEMSTICK_SYS_PAR8);
|
rc = mspro_block_set_interface(card, MEMSTICK_SYS_PAR8);
|
||||||
|
@ -905,11 +905,11 @@ try_again:
|
||||||
MEMSTICK_PAR8);
|
MEMSTICK_PAR8);
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"%s: switching to 8-bit parallel mode\n",
|
"%s: switching to 8-bit parallel mode\n",
|
||||||
card->dev.bus_id);
|
dev_name(&card->dev));
|
||||||
} else
|
} else
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"%s: could not switch to 8-bit mode, error %d\n",
|
"%s: could not switch to 8-bit mode, error %d\n",
|
||||||
card->dev.bus_id, rc);
|
dev_name(&card->dev), rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
card->next_request = h_mspro_block_req_init;
|
card->next_request = h_mspro_block_req_init;
|
||||||
|
@ -922,7 +922,7 @@ try_again:
|
||||||
if (rc) {
|
if (rc) {
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"%s: interface error, trying to fall back to serial\n",
|
"%s: interface error, trying to fall back to serial\n",
|
||||||
card->dev.bus_id);
|
dev_name(&card->dev));
|
||||||
msb->system = MEMSTICK_SYS_SERIAL;
|
msb->system = MEMSTICK_SYS_SERIAL;
|
||||||
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF);
|
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF);
|
||||||
msleep(10);
|
msleep(10);
|
||||||
|
@ -992,14 +992,14 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
|
||||||
|
|
||||||
if (be16_to_cpu(attr->signature) != MSPRO_BLOCK_SIGNATURE) {
|
if (be16_to_cpu(attr->signature) != MSPRO_BLOCK_SIGNATURE) {
|
||||||
printk(KERN_ERR "%s: unrecognized device signature %x\n",
|
printk(KERN_ERR "%s: unrecognized device signature %x\n",
|
||||||
card->dev.bus_id, be16_to_cpu(attr->signature));
|
dev_name(&card->dev), be16_to_cpu(attr->signature));
|
||||||
rc = -ENODEV;
|
rc = -ENODEV;
|
||||||
goto out_free_attr;
|
goto out_free_attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr->count > MSPRO_BLOCK_MAX_ATTRIBUTES) {
|
if (attr->count > MSPRO_BLOCK_MAX_ATTRIBUTES) {
|
||||||
printk(KERN_WARNING "%s: way too many attribute entries\n",
|
printk(KERN_WARNING "%s: way too many attribute entries\n",
|
||||||
card->dev.bus_id);
|
dev_name(&card->dev));
|
||||||
attr_count = MSPRO_BLOCK_MAX_ATTRIBUTES;
|
attr_count = MSPRO_BLOCK_MAX_ATTRIBUTES;
|
||||||
} else
|
} else
|
||||||
attr_count = attr->count;
|
attr_count = attr->count;
|
||||||
|
|
|
@ -546,7 +546,7 @@ static void tifm_ms_abort(unsigned long data)
|
||||||
printk(KERN_ERR
|
printk(KERN_ERR
|
||||||
"%s : card failed to respond for a long period of time "
|
"%s : card failed to respond for a long period of time "
|
||||||
"(%x, %x)\n",
|
"(%x, %x)\n",
|
||||||
host->dev->dev.bus_id, host->req ? host->req->tpc : 0,
|
dev_name(&host->dev->dev), host->req ? host->req->tpc : 0,
|
||||||
host->cmd_flags);
|
host->cmd_flags);
|
||||||
|
|
||||||
tifm_eject(host->dev);
|
tifm_eject(host->dev);
|
||||||
|
@ -561,7 +561,7 @@ static int tifm_ms_probe(struct tifm_dev *sock)
|
||||||
if (!(TIFM_SOCK_STATE_OCCUPIED
|
if (!(TIFM_SOCK_STATE_OCCUPIED
|
||||||
& readl(sock->addr + SOCK_PRESENT_STATE))) {
|
& readl(sock->addr + SOCK_PRESENT_STATE))) {
|
||||||
printk(KERN_WARNING "%s : card gone, unexpectedly\n",
|
printk(KERN_WARNING "%s : card gone, unexpectedly\n",
|
||||||
sock->dev.bus_id);
|
dev_name(&sock->dev));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue