Skip to content

Commit

Permalink
rpmsg: use local 'dev' variable
Browse files Browse the repository at this point in the history
'&rpdev->dev' is already cached as local variable, so use it to simplify
the code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220429195946.1061725-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
krzk authored and gregkh committed May 6, 2022
1 parent bb17d11 commit 38ea74e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/rpmsg/rpmsg_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,10 @@ int rpmsg_register_device_override(struct rpmsg_device *rpdev,
if (driver_override)
strcpy(rpdev->id.name, driver_override);

dev_set_name(&rpdev->dev, "%s.%s.%d.%d", dev_name(dev->parent),
dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent),
rpdev->id.name, rpdev->src, rpdev->dst);

rpdev->dev.bus = &rpmsg_bus;
dev->bus = &rpmsg_bus;

device_initialize(dev);
if (driver_override) {
Expand All @@ -627,7 +627,7 @@ int rpmsg_register_device_override(struct rpmsg_device *rpdev,
dev_err(dev, "device_add failed: %d\n", ret);
kfree(rpdev->driver_override);
rpdev->driver_override = NULL;
put_device(&rpdev->dev);
put_device(dev);
}

return ret;
Expand Down

0 comments on commit 38ea74e

Please sign in to comment.