diff options
author | Simon Glass | 2018-12-28 14:23:10 -0700 |
---|---|---|
committer | Simon Glass | 2019-01-14 17:47:13 -0700 |
commit | a61cbad78e67963944e7d719f0aee27b8aef6c02 (patch) | |
tree | 5b274a956002e4d7c37e19ae63293015be15f9bc /drivers/serial/serial-uclass.c | |
parent | 3de04e771c4b230ad08c7b22871dedf5f69032b9 (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.c | 9 |
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; } |