Commit c5ff7de2 authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Lee Jones

serdev: Make .remove in struct serdev_device_driver optional

Using devres infrastructure it is possible to write a serdev driver
that doesn't have any code that needs to be called as a part of
.remove. Add code to make .remove optional.
Acked-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Acked-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 0d85adb5
......@@ -268,7 +268,7 @@ static int serdev_drv_probe(struct device *dev)
static int serdev_drv_remove(struct device *dev)
{
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
if (sdrv->remove)
sdrv->remove(to_serdev_device(dev));
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment