diff mbox series

[SCSI] esas2r: Use kobj_to_dev()

Message ID 20220512011749.1621689-1-chi.minghao@zte.com.cn (mailing list archive)
State Rejected
Headers show
Series [SCSI] esas2r: Use kobj_to_dev() | expand

Commit Message

CGEL May 12, 2022, 1:17 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Use kobj_to_dev() instead of open-coding it.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 drivers/scsi/esas2r/esas2r_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.25.1
diff mbox series

Patch

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;