Skip to content

Commit 0d295b1

Browse files
ukleinekgregkh
authored andcommitted
fsi: scom: Convert to fsi bus probe mechanism
The fsi bus got a dedicated probe function. Make use of that. This fixes a runtime warning about the driver needing to be converted to the bus probe method. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Acked-by: Eddie James <eajames@linux.ibm.com> Link: https://patch.msgid.link/d02a22f2f5442dc03d1d803d1b8190bc89bc71d4.1765279318.git.u.kleine-koenig@baylibre.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0cf9580 commit 0d295b1

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

drivers/fsi/fsi-scom.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -527,16 +527,16 @@ static void scom_free(struct device *dev)
527527
kfree(scom);
528528
}
529529

530-
static int scom_probe(struct device *dev)
530+
static int scom_probe(struct fsi_device *fsi_dev)
531531
{
532-
struct fsi_device *fsi_dev = to_fsi_dev(dev);
532+
struct device *dev = &fsi_dev->dev;
533533
struct scom_device *scom;
534534
int rc, didx;
535535

536536
scom = kzalloc(sizeof(*scom), GFP_KERNEL);
537537
if (!scom)
538538
return -ENOMEM;
539-
dev_set_drvdata(dev, scom);
539+
fsi_set_drvdata(fsi_dev, scom);
540540
mutex_init(&scom->lock);
541541

542542
/* Grab a reference to the device (parent of our cdev), we'll drop it later */
@@ -574,18 +574,16 @@ static int scom_probe(struct device *dev)
574574
return rc;
575575
}
576576

577-
static int scom_remove(struct device *dev)
577+
static void scom_remove(struct fsi_device *fsi_dev)
578578
{
579-
struct scom_device *scom = dev_get_drvdata(dev);
579+
struct scom_device *scom = fsi_get_drvdata(fsi_dev);
580580

581581
mutex_lock(&scom->lock);
582582
scom->dead = true;
583583
mutex_unlock(&scom->lock);
584584
cdev_device_del(&scom->cdev, &scom->dev);
585585
fsi_free_minor(scom->dev.devt);
586586
put_device(&scom->dev);
587-
588-
return 0;
589587
}
590588

591589
static const struct of_device_id scom_of_ids[] = {
@@ -604,11 +602,11 @@ static const struct fsi_device_id scom_ids[] = {
604602

605603
static struct fsi_driver scom_drv = {
606604
.id_table = scom_ids,
605+
.probe = scom_probe,
606+
.remove = scom_remove,
607607
.drv = {
608608
.name = "scom",
609609
.of_match_table = scom_of_ids,
610-
.probe = scom_probe,
611-
.remove = scom_remove,
612610
}
613611
};
614612

0 commit comments

Comments
 (0)