Skip to contentSkip to conversation

s390/cio: use kobj_to_dev() API

PATCH Applied [email protected] 3 participants 3 messages Feb 14, 2020 – Feb 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 s390/cio: use kobj_to_dev() API

From: chenqiwu <[email protected]>

Use kobj_to_dev() API instead of container_of().

---
changes in v2:
- add signed off for my gmail adderss.
---

 drivers/s390/cio/chp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/cio/chp.c +2 -2
index 51038ec..dfcbe54 100644
@@ -135,7 +135,7 @@ static ssize_t chp_measurement_chars_read(struct file *filp,
 	struct channel_path *chp;
 	struct device *device;
 
-	device = container_of(kobj, struct device, kobj);
+	device = kobj_to_dev(kobj);
 	chp = to_channelpath(device);
 	if (chp->cmg == -1)
 		return 0;
@@ -184,7 +184,7 @@ static ssize_t chp_measurement_read(struct file *filp, struct kobject *kobj,
 	struct device *device;
 	unsigned int size;
 
-	device = container_of(kobj, struct device, kobj);
+	device = kobj_to_dev(kobj);
 	chp = to_channelpath(device);
 	css = to_css(chp->dev.parent);
 
Signature · 1 line
1.9.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · On Fri, 14 Feb 2020 21:51:33 +0800 [email protected] wrote:

From: chenqiwu <[email protected]>

Use kobj_to_dev() API instead of container_of().

Quoted 8 lines

---
changes in v2:
- add signed off for my gmail adderss.
---

 drivers/s390/cio/chp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
maintainer Applied
#2 lore raw
In reply to [email protected]
Quoted 38 lines · On Fri, Feb 14, 2020 at 09:51:33PM +0800, [email protected] wrote:

From: chenqiwu <[email protected]>

Use kobj_to_dev() API instead of container_of().

---
changes in v2:
- add signed off for my gmail adderss.
---

 drivers/s390/cio/chp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/s390/cio/chp.c +2 -2
index 51038ec..dfcbe54 100644
@@ -135,7 +135,7 @@ static ssize_t chp_measurement_chars_read(struct file *filp,
 	struct channel_path *chp;
 	struct device *device;
 
-	device = container_of(kobj, struct device, kobj);
+	device = kobj_to_dev(kobj);
 	chp = to_channelpath(device);
 	if (chp->cmg == -1)
 		return 0;
@@ -184,7 +184,7 @@ static ssize_t chp_measurement_read(struct file *filp, struct kobject *kobj,
 	struct device *device;
 	unsigned int size;
 
-	device = container_of(kobj, struct device, kobj);
+	device = kobj_to_dev(kobj);
 	chp = to_channelpath(device);
 	css = to_css(chp->dev.parent);
 
Signature · 1 line
1.9.1

Applied, thanks