Re: [PATCH 1/3] USB: serial: use static attribute groups for sysfs entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 05, 2015 at 02:36:23PM +0100, Takashi Iwai wrote:

>  static int usb_serial_device_probe(struct device *dev)
>  {
>  	struct usb_serial_driver *driver;
> @@ -72,15 +79,9 @@ static int usb_serial_device_probe(struct device *dev)
>  			goto exit_with_autopm;
>  	}
>  
> -	retval = device_create_file(dev, &dev_attr_port_number);
> -	if (retval) {
> -		if (driver->port_remove)
> -			retval = driver->port_remove(port);
> -		goto exit_with_autopm;
> -	}
> -
>  	minor = port->minor;
> -	tty_register_device(usb_serial_tty_driver, minor, dev);
> +	tty_register_device_attr(usb_serial_tty_driver, minor, dev, NULL,
> +				 usb_serial_dev_groups);

This is just wrong. You're moving a usb-serial-port device attribute to
the tty class device (i.e. ABI breakage) and you're not updating the
attribute operation either.

I assume you haven't tested this, as the kernel would likely crash or,
if you're lucky, just return a bogus port number when you try to read
the attribute file.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux