Skip to content

Commit

Permalink
pcmcia: Switch to using the new API kobj_to_dev()
Browse files Browse the repository at this point in the history
fixed the following coccicheck:
drivers/pcmcia/cistpl.c:1557:54-55: WARNING opportunity for kobj_to_dev()
drivers/pcmcia/cistpl.c:1584:53-54: WARNING opportunity for kobj_to_dev()

Signed-off-by: Tian Tao <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
Tian Tao authored and Dominik Brodowski committed Jan 4, 2021
1 parent e71ba94 commit 4ce6b24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pcmcia/cistpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ static ssize_t pccard_show_cis(struct file *filp, struct kobject *kobj,
if (off + count > size)
count = size - off;

s = to_socket(container_of(kobj, struct device, kobj));
s = to_socket(kobj_to_dev(kobj));

if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
Expand All @@ -1581,7 +1581,7 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj,
if (error)
return error;

s = to_socket(container_of(kobj, struct device, kobj));
s = to_socket(kobj_to_dev(kobj));

if (off)
return -EINVAL;
Expand Down

0 comments on commit 4ce6b24

Please sign in to comment.