Re: [PATCH 002/002] USB: serial: sierra driver autosuspend support

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

 



On Thu, 9 Jul 2009, Elina Pasheva wrote:

> Subject: [PATCH 002/002] USB: serial: sierra driver autosuspend support
> From: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx>

> +/* sysfs attributes */
> +static int sierra_create_sysfs_attrs(struct usb_serial_port *port);
> +/* Note: attribute created for each port; removed on disconnect */

> +static int sierra_create_sysfs_attrs(struct usb_serial_port *port)
> +{
> +	return device_create_file(&port->dev, &dev_attr_suspend_status);
> +}

> @@ -866,7 +980,10 @@ static struct usb_serial_driver sierra_d
>  	.tiocmset          = sierra_tiocmset,
>  	.attach            = sierra_startup,
>  	.disconnect        = sierra_disconnect,
> +	.port_probe	   = sierra_create_sysfs_attrs,
>  	.read_int_callback = sierra_instat_callback,
> +	.suspend           = sierra_suspend,
> +	.resume            = sierra_resume,
>  };

It seems very strange to have code for creating sysfs attributes and 
not have code for removing them.

The comment says they are removed upon disconnect.  But that's not 
right, because they are created during port_probe, not during attach.  
Hence they should be removed during port_remove.

Alan Stern

--
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