[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220512011749.1621689-1-chi.minghao@zte.com.cn>
Date: Thu, 12 May 2022 01:17:49 +0000
From: cgel.zte@...il.com
To: linuxdrivers@...otech.com
Cc: jejb@...ux.ibm.com, martin.petersen@...cle.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] [SCSI] esas2r: Use kobj_to_dev()
From: Minghao Chi <chi.minghao@....com.cn>
Use kobj_to_dev() instead of open-coding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
drivers/scsi/esas2r/esas2r_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index 7a4eadad23d7..f030ff6dc5b2 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -59,7 +59,7 @@ struct esas2r_adapter *esas2r_adapters[MAX_ADAPTERS];
static struct esas2r_adapter *esas2r_adapter_from_kobj(struct kobject *kobj)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct Scsi_Host *host = class_to_shost(dev);
return (struct esas2r_adapter *)host->hostdata;
--
2.25.1
Powered by blists - more mailing lists