diff mbox series

[v2,2/2] scsi: usb: uas: Implement the new shutdown callback

Message ID BAC247FF-CDA3-4C34-A9CC-A429E3AD13C3@live.com (mailing list archive)
State Superseded
Headers show
Series USB: Simplify running code on shutdown for USB devices | expand

Commit Message

Aditya Garg July 6, 2024, 10:01 a.m. UTC
From: Kerem Karabay <kekrby@gmail.com>

This patch implements the new shutdown callback method added to
usb_driver on the UAS driver.

Signed-off-by: Kerem Karabay <kekrby@gmail.com>
Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
 drivers/usb/storage/uas.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Greg KH July 6, 2024, 10:08 a.m. UTC | #1
On Sat, Jul 06, 2024 at 10:01:38AM +0000, Aditya Garg wrote:
> From: Kerem Karabay <kekrby@gmail.com>
> 
> This patch implements the new shutdown callback method added to
> usb_driver on the UAS driver.
> 
> Signed-off-by: Kerem Karabay <kekrby@gmail.com>
> Signed-off-by: Aditya Garg <gargaditya08@live.com>
> ---
>  drivers/usb/storage/uas.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Why the "scsi:" on the subject line?  This is not that directory :(
Greg KH July 6, 2024, 10:09 a.m. UTC | #2
On Sat, Jul 06, 2024 at 10:01:38AM +0000, Aditya Garg wrote:
> From: Kerem Karabay <kekrby@gmail.com>
> 
> This patch implements the new shutdown callback method added to
> usb_driver on the UAS driver.

Again, says what it does, but not why.
Aditya Garg July 6, 2024, 10:16 a.m. UTC | #3
> On 6 Jul 2024, at 3:39 PM, gregkh@linuxfoundation.org wrote:
> 
> On Sat, Jul 06, 2024 at 10:01:38AM +0000, Aditya Garg wrote:
>> From: Kerem Karabay <kekrby@gmail.com>
>> 
>> This patch implements the new shutdown callback method added to
>> usb_driver on the UAS driver.
>> 
>> Signed-off-by: Kerem Karabay <kekrby@gmail.com>
>> Signed-off-by: Aditya Garg <gargaditya08@live.com>
>> ---
>> drivers/usb/storage/uas.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Why the "scsi:" on the subject line?  This is not that directory :(
> 

I'll remove scsi: from the subject.
Aditya Garg July 6, 2024, 10:20 a.m. UTC | #4
> On 6 Jul 2024, at 3:39 PM, gregkh@linuxfoundation.org wrote:
> 
> On Sat, Jul 06, 2024 at 10:01:38AM +0000, Aditya Garg wrote:
>> From: Kerem Karabay <kekrby@gmail.com>
>> 
>> This patch implements the new shutdown callback method added to
>> usb_driver on the UAS driver.
> 
> Again, says what it does, but not why.
> 

A standard implementation of shutdown callback has been implemented
for USB drivers. Since the UAS driver implements a shutdown callback
this patch enables it to use the new standard implementation.

Now looks fine?

Is the body of the first patch fine?
Aditya Garg July 6, 2024, 12:06 p.m. UTC | #5
> On 6 Jul 2024, at 3:39 PM, gregkh@linuxfoundation.org wrote:
> 
> On Sat, Jul 06, 2024 at 10:01:38AM +0000, Aditya Garg wrote:
>> From: Kerem Karabay <kekrby@gmail.com>
>> 
>> This patch implements the new shutdown callback method added to
>> usb_driver on the UAS driver.
> 
> Again, says what it does, but not why.
> 

Sent a v3:

https://lore.kernel.org/all/58227E2C-1886-40AD-8F80-7C618EF2D8F2@live.com/T/#t
diff mbox series

Patch

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index b610a2de4..0cdbcf825 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -1232,9 +1232,8 @@  static void uas_disconnect(struct usb_interface *intf)
  * hang on reboot when the device is still in uas mode. Note the reset is
  * necessary as some devices won't revert to usb-storage mode without it.
  */
-static void uas_shutdown(struct device *dev)
+static void uas_shutdown(struct usb_interface *intf)
 {
-	struct usb_interface *intf = to_usb_interface(dev);
 	struct usb_device *udev = interface_to_usbdev(intf);
 	struct Scsi_Host *shost = usb_get_intfdata(intf);
 	struct uas_dev_info *devinfo = (struct uas_dev_info *)shost->hostdata;
@@ -1257,7 +1256,7 @@  static struct usb_driver uas_driver = {
 	.suspend = uas_suspend,
 	.resume = uas_resume,
 	.reset_resume = uas_reset_resume,
-	.driver.shutdown = uas_shutdown,
+	.shutdown = uas_shutdown,
 	.id_table = uas_usb_ids,
 };