aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial/serial-uclass.c
diff options
context:
space:
mode:
authorSimon Glass2018-12-28 14:23:09 -0700
committerSimon Glass2019-01-14 17:47:13 -0700
commit3de04e771c4b230ad08c7b22871dedf5f69032b9 (patch)
treee8e0bac50268aea26f79ff13e6b70aff85c7e46c /drivers/serial/serial-uclass.c
parent67d1b0513079049baa3e0e38603eb33a3857af5d (diff)
dm: serial: Adjust serial_setconfig() 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 81f1067f422..669c82f3793 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -305,16 +305,13 @@ int serial_getconfig(struct udevice *dev, uint *config)
return 0;
}
-int serial_setconfig(uint config)
+int serial_setconfig(struct udevice *dev, uint config)
{
struct dm_serial_ops *ops;
- if (!gd->cur_serial_dev)
- return 0;
-
- ops = serial_get_ops(gd->cur_serial_dev);
+ ops = serial_get_ops(dev);
if (ops->setconfig)
- return ops->setconfig(gd->cur_serial_dev, config);
+ return ops->setconfig(dev, config);
return 0;
}