Commit dd868ae6 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Mark Brown

media: usb/msi2500: Follow renaming of SPI "master" to "controller"

In commit 8caab75f ("spi: Generalize SPI "master" to "controller"")
some functions and struct members were renamed. To not break all drivers
compatibility macros were provided.

To be able to remove these compatibility macros push the renaming into
this driver.
Acked-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/d4dc8acc3c4105b9093e97f6337a81d11e6d30ae.1707324794.git.u.kleine-koenig@pengutronix.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent cfa13a64
...@@ -107,7 +107,7 @@ struct msi2500_dev { ...@@ -107,7 +107,7 @@ struct msi2500_dev {
struct video_device vdev; struct video_device vdev;
struct v4l2_device v4l2_dev; struct v4l2_device v4l2_dev;
struct v4l2_subdev *v4l2_subdev; struct v4l2_subdev *v4l2_subdev;
struct spi_master *master; struct spi_controller *ctlr;
/* videobuf2 queue and queued buffers list */ /* videobuf2 queue and queued buffers list */
struct vb2_queue vb_queue; struct vb2_queue vb_queue;
...@@ -574,7 +574,7 @@ static void msi2500_disconnect(struct usb_interface *intf) ...@@ -574,7 +574,7 @@ static void msi2500_disconnect(struct usb_interface *intf)
dev->udev = NULL; dev->udev = NULL;
v4l2_device_disconnect(&dev->v4l2_dev); v4l2_device_disconnect(&dev->v4l2_dev);
video_unregister_device(&dev->vdev); video_unregister_device(&dev->vdev);
spi_unregister_master(dev->master); spi_unregister_controller(dev->ctlr);
mutex_unlock(&dev->v4l2_lock); mutex_unlock(&dev->v4l2_lock);
mutex_unlock(&dev->vb_queue_lock); mutex_unlock(&dev->vb_queue_lock);
...@@ -1136,10 +1136,10 @@ static void msi2500_video_release(struct v4l2_device *v) ...@@ -1136,10 +1136,10 @@ static void msi2500_video_release(struct v4l2_device *v)
kfree(dev); kfree(dev);
} }
static int msi2500_transfer_one_message(struct spi_master *master, static int msi2500_transfer_one_message(struct spi_controller *ctlr,
struct spi_message *m) struct spi_message *m)
{ {
struct msi2500_dev *dev = spi_master_get_devdata(master); struct msi2500_dev *dev = spi_controller_get_devdata(ctlr);
struct spi_transfer *t; struct spi_transfer *t;
int ret = 0; int ret = 0;
u32 data; u32 data;
...@@ -1154,7 +1154,7 @@ static int msi2500_transfer_one_message(struct spi_master *master, ...@@ -1154,7 +1154,7 @@ static int msi2500_transfer_one_message(struct spi_master *master,
} }
m->status = ret; m->status = ret;
spi_finalize_current_message(master); spi_finalize_current_message(ctlr);
return ret; return ret;
} }
...@@ -1163,7 +1163,7 @@ static int msi2500_probe(struct usb_interface *intf, ...@@ -1163,7 +1163,7 @@ static int msi2500_probe(struct usb_interface *intf,
{ {
struct msi2500_dev *dev; struct msi2500_dev *dev;
struct v4l2_subdev *sd; struct v4l2_subdev *sd;
struct spi_master *master; struct spi_controller *ctlr;
int ret; int ret;
static struct spi_board_info board_info = { static struct spi_board_info board_info = {
.modalias = "msi001", .modalias = "msi001",
...@@ -1220,30 +1220,30 @@ static int msi2500_probe(struct usb_interface *intf, ...@@ -1220,30 +1220,30 @@ static int msi2500_probe(struct usb_interface *intf,
} }
/* SPI master adapter */ /* SPI master adapter */
master = spi_alloc_master(dev->dev, 0); ctlr = spi_alloc_master(dev->dev, 0);
if (master == NULL) { if (ctlr == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_unregister_v4l2_dev; goto err_unregister_v4l2_dev;
} }
dev->master = master; dev->ctlr = ctlr;
master->bus_num = -1; ctlr->bus_num = -1;
master->num_chipselect = 1; ctlr->num_chipselect = 1;
master->transfer_one_message = msi2500_transfer_one_message; ctlr->transfer_one_message = msi2500_transfer_one_message;
spi_master_set_devdata(master, dev); spi_controller_set_devdata(ctlr, dev);
ret = spi_register_master(master); ret = spi_register_controller(ctlr);
if (ret) { if (ret) {
spi_master_put(master); spi_controller_put(ctlr);
goto err_unregister_v4l2_dev; goto err_unregister_v4l2_dev;
} }
/* load v4l2 subdevice */ /* load v4l2 subdevice */
sd = v4l2_spi_new_subdev(&dev->v4l2_dev, master, &board_info); sd = v4l2_spi_new_subdev(&dev->v4l2_dev, ctlr, &board_info);
dev->v4l2_subdev = sd; dev->v4l2_subdev = sd;
if (sd == NULL) { if (sd == NULL) {
dev_err(dev->dev, "cannot get v4l2 subdevice\n"); dev_err(dev->dev, "cannot get v4l2 subdevice\n");
ret = -ENODEV; ret = -ENODEV;
goto err_unregister_master; goto err_unregister_controller;
} }
/* Register controls */ /* Register controls */
...@@ -1276,8 +1276,8 @@ static int msi2500_probe(struct usb_interface *intf, ...@@ -1276,8 +1276,8 @@ static int msi2500_probe(struct usb_interface *intf,
return 0; return 0;
err_free_controls: err_free_controls:
v4l2_ctrl_handler_free(&dev->hdl); v4l2_ctrl_handler_free(&dev->hdl);
err_unregister_master: err_unregister_controller:
spi_unregister_master(dev->master); spi_unregister_controller(dev->ctlr);
err_unregister_v4l2_dev: err_unregister_v4l2_dev:
v4l2_device_unregister(&dev->v4l2_dev); v4l2_device_unregister(&dev->v4l2_dev);
err_free_mem: err_free_mem:
......
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