[PATCH 8/9] console: allow to specify the device id

Sascha Hauer s.hauer at pengutronix.de
Mon Jan 5 02:46:23 PST 2015


On Tue, Dec 23, 2014 at 07:21:57PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> so we can use dynamic number id with specific devname
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> ---
>  common/console.c              | 2 +-
>  drivers/usb/gadget/u_serial.c | 1 +
>  include/console.h             | 1 +
>  3 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/common/console.c b/common/console.c
> index bba13a5..602ab2e 100644
> --- a/common/console.c
> +++ b/common/console.c
> @@ -188,7 +188,7 @@ int console_register(struct console_device *newcdev)
>  		console_init_early();
>  
>  	if (newcdev->devname) {
> -		dev->id = DEVICE_ID_SINGLE;
> +		dev->id = newcdev->devid;
>  		strcpy(dev->name, newcdev->devname);
>  	} else {
>  		dev->id = DEVICE_ID_DYNAMIC;
> diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
> index 8c58746..1e5e809 100644
> --- a/drivers/usb/gadget/u_serial.c
> +++ b/drivers/usb/gadget/u_serial.c
> @@ -530,6 +530,7 @@ int gserial_connect(struct gserial *gser, u8 port_num)
>  	cdev->flush = serial_flush;
>  	cdev->setbrg = serial_setbaudrate;
>  	cdev->devname = "usbserial";
> +	cdev->devid = DEVICE_ID_SINGLE;

The same is needed in drivers/serial/serial_imx.c

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list