Commit c31d32ba authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

ipack: Fail earlier for drivers without probe function

A driver without a probe function isn't useful as it can never be used.
Let registering such a driver fail already instead of failing every
binding.

This is only cosmetic as there is no ipack driver without a probe function.
Signed-off-by: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
Acked-by: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Link: https://lore.kernel.org/r/20210207215556.96371-1-uwe@kleine-koenig.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3e3eaab
...@@ -64,9 +64,6 @@ static int ipack_bus_probe(struct device *device) ...@@ -64,9 +64,6 @@ static int ipack_bus_probe(struct device *device)
struct ipack_device *dev = to_ipack_dev(device); struct ipack_device *dev = to_ipack_dev(device);
struct ipack_driver *drv = to_ipack_driver(device->driver); struct ipack_driver *drv = to_ipack_driver(device->driver);
if (!drv->ops->probe)
return -EINVAL;
return drv->ops->probe(dev); return drv->ops->probe(dev);
} }
...@@ -252,6 +249,9 @@ EXPORT_SYMBOL_GPL(ipack_bus_unregister); ...@@ -252,6 +249,9 @@ EXPORT_SYMBOL_GPL(ipack_bus_unregister);
int ipack_driver_register(struct ipack_driver *edrv, struct module *owner, int ipack_driver_register(struct ipack_driver *edrv, struct module *owner,
const char *name) const char *name)
{ {
if (!edrv->ops->probe)
return -EINVAL;
edrv->driver.owner = owner; edrv->driver.owner = owner;
edrv->driver.name = name; edrv->driver.name = name;
edrv->driver.bus = &ipack_bus_type; edrv->driver.bus = &ipack_bus_type;
......
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