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>
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 669c82f..d4488a2 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -316,21 +316,18 @@
 	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;
 }