aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial/serial-uclass.c
diff options
context:
space:
mode:
authorSimon Glass2018-12-28 14:23:10 -0700
committerSimon Glass2019-01-14 17:47:13 -0700
commita61cbad78e67963944e7d719f0aee27b8aef6c02 (patch)
tree5b274a956002e4d7c37e19ae63293015be15f9bc /drivers/serial/serial-uclass.c
parent3de04e771c4b230ad08c7b22871dedf5f69032b9 (diff)
dm: serial: Adjust serial_getinfo() to use proper API
All driver-model functions should have a device as the first parameter. Update this function accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Diffstat (limited to 'drivers/serial/serial-uclass.c')
-rw-r--r--drivers/serial/serial-uclass.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 669c82f3793..d4488a2cc28 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -316,21 +316,18 @@ int serial_setconfig(struct udevice *dev, uint config)
return 0;
}
-int serial_getinfo(struct serial_device_info *info)
+int serial_getinfo(struct udevice *dev, struct serial_device_info *info)
{
struct dm_serial_ops *ops;
- if (!gd->cur_serial_dev)
- return -ENODEV;
-
if (!info)
return -EINVAL;
info->baudrate = gd->baudrate;
- ops = serial_get_ops(gd->cur_serial_dev);
+ ops = serial_get_ops(dev);
if (ops->getinfo)
- return ops->getinfo(gd->cur_serial_dev, info);
+ return ops->getinfo(dev, info);
return -EINVAL;
}