* [PATCH] USB: storage: register disks as usbdiskx
@ 2013-10-18 10:07 Sascha Hauer
2013-10-18 13:00 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2013-10-18 10:07 UTC (permalink / raw)
To: barebox
To better identify them as USB storage devices. Also make the
info message look nicer.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/usb/storage/usb.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index e4b08b9..fbf458f 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -392,12 +392,11 @@ static int usb_stor_add_blkdev(struct us_data *us, struct device_d *dev,
if (result < 0)
goto BadDevice;
- result = cdev_find_free_index("disk");
+ result = cdev_find_free_index("usbdisk");
if (result == -1)
pr_err("Cannot find a free number for the disk node\n");
- pr_info("Using index %d for the new disk\n", result);
- pblk_dev->blk.cdev.name = asprintf("disk%d", result);
+ pblk_dev->blk.cdev.name = asprintf("usbdisk%d", result);
pblk_dev->blk.blockbits = SECTOR_SHIFT;
result = blockdevice_register(&pblk_dev->blk);
@@ -406,6 +405,8 @@ static int usb_stor_add_blkdev(struct us_data *us, struct device_d *dev,
goto BadDevice;
}
+ dev_info(dev, "registered /dev/%s\n", pblk_dev->blk.cdev.name);
+
/* create partitions on demand */
result = parse_partition_table(&pblk_dev->blk);
if (result != 0)
--
1.8.4.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] USB: storage: register disks as usbdiskx
2013-10-18 10:07 [PATCH] USB: storage: register disks as usbdiskx Sascha Hauer
@ 2013-10-18 13:00 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-10-18 13:00 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 12:07 Fri 18 Oct , Sascha Hauer wrote:
> To better identify them as USB storage devices. Also make the
> info message look nicer.
we brake the env support
I think it's time to add symblink support to devfs
so we can have disk%x and a usbdisk%x
so we do not brake it
Best Regards,
J.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/usb/storage/usb.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> index e4b08b9..fbf458f 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -392,12 +392,11 @@ static int usb_stor_add_blkdev(struct us_data *us, struct device_d *dev,
> if (result < 0)
> goto BadDevice;
>
> - result = cdev_find_free_index("disk");
> + result = cdev_find_free_index("usbdisk");
> if (result == -1)
> pr_err("Cannot find a free number for the disk node\n");
> - pr_info("Using index %d for the new disk\n", result);
>
> - pblk_dev->blk.cdev.name = asprintf("disk%d", result);
> + pblk_dev->blk.cdev.name = asprintf("usbdisk%d", result);
> pblk_dev->blk.blockbits = SECTOR_SHIFT;
>
> result = blockdevice_register(&pblk_dev->blk);
> @@ -406,6 +405,8 @@ static int usb_stor_add_blkdev(struct us_data *us, struct device_d *dev,
> goto BadDevice;
> }
>
> + dev_info(dev, "registered /dev/%s\n", pblk_dev->blk.cdev.name);
> +
> /* create partitions on demand */
> result = parse_partition_table(&pblk_dev->blk);
> if (result != 0)
> --
> 1.8.4.rc3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-18 13:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-18 10:07 [PATCH] USB: storage: register disks as usbdiskx Sascha Hauer
2013-10-18 13:00 ` Jean-Christophe PLAGNIOL-VILLARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox