mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
rpmsg updates for v6.9
This transitions rpmsg_ctrl and rpmsg_char drivers away from the deprecated ida_simple_*() API. It also makes the rpmsg_bus const. -----BEGIN PGP SIGNATURE----- iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmX3oCcVHGFuZGVyc3Nv bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FmqwQAJYCKxvdD1pXdkPb7tfRi/MfbrqQ c6WJueW+OXsV1WFiexf0FdsMCpUl4B/fCE1f7mHCAC8gdqOAr0LEnVP4sekhavB6 GVsXcB41kFfDHENsHVgUAiIpgHYjyk7K8Ge5Zl3zk9I2VWBH4OWJ8nmk6xDawZyQ uzyLJH4/D23xM9VI22Q3Z8mKHDRTMhyxLen3zdKxbZNJ7xlFMtMu9f//J+TtfZGs cJeJL57Gd/AGtlStXHEF3gwA0UdG+8LqVR4PgUjL+H3TFDnace8SP15leQqfn5uy TlVZBXrK/DyHeQfAYXQTsdkSIsYnEqwjA1rPhZHyAaWEMbTLcsYBjB0DBY87O45x LPyY4t/lRxEczYcurUGvTAAN9hBfAYgiptlJmhqOFyn3ppWaIdGU2cT3BAdo4WkN W+KkhtxkkPeQlJLNRnc+gEetWKaCR7YQygpbcDsfU3b/XiVFU1BY+Uyy4bud20zi XwGAaSXV8n8Our8vR6Sw9HVtddIHqyhluGfxheybEKtJEOsGwWEvgHNIsloEc0ZJ Uwkg2PaqFNQcaYZGBn4JN+nM0SpUyYA34TNduYg025vlkCv2DmiUhm5zW8oMIzOI xk7EL0zdiXD9utl4nAwts7A0v1B4tgeeowUjHcYWzB0qDvxbS/71K1QFDS9cya87 mtCBzB+rAEmyf8zx =9yTY -----END PGP SIGNATURE----- Merge tag 'rpmsg-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull rpmsg updates from Bjorn Andersson: "This transitions rpmsg_ctrl and rpmsg_char drivers away from the deprecated ida_simple_*() API. It also makes the rpmsg_bus const" * tag 'rpmsg-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: core: Make rpmsg_bus const rpmsg: Remove usage of the deprecated ida_simple_xx() API
This commit is contained in:
commit
91f263dda6
@ -399,8 +399,8 @@ static void rpmsg_eptdev_release_device(struct device *dev)
|
||||
{
|
||||
struct rpmsg_eptdev *eptdev = dev_to_eptdev(dev);
|
||||
|
||||
ida_simple_remove(&rpmsg_ept_ida, dev->id);
|
||||
ida_simple_remove(&rpmsg_minor_ida, MINOR(eptdev->dev.devt));
|
||||
ida_free(&rpmsg_ept_ida, dev->id);
|
||||
ida_free(&rpmsg_minor_ida, MINOR(eptdev->dev.devt));
|
||||
kfree(eptdev);
|
||||
}
|
||||
|
||||
@ -441,12 +441,12 @@ static int rpmsg_chrdev_eptdev_add(struct rpmsg_eptdev *eptdev, struct rpmsg_cha
|
||||
|
||||
eptdev->chinfo = chinfo;
|
||||
|
||||
ret = ida_simple_get(&rpmsg_minor_ida, 0, RPMSG_DEV_MAX, GFP_KERNEL);
|
||||
ret = ida_alloc_max(&rpmsg_minor_ida, RPMSG_DEV_MAX - 1, GFP_KERNEL);
|
||||
if (ret < 0)
|
||||
goto free_eptdev;
|
||||
dev->devt = MKDEV(MAJOR(rpmsg_major), ret);
|
||||
|
||||
ret = ida_simple_get(&rpmsg_ept_ida, 0, 0, GFP_KERNEL);
|
||||
ret = ida_alloc(&rpmsg_ept_ida, GFP_KERNEL);
|
||||
if (ret < 0)
|
||||
goto free_minor_ida;
|
||||
dev->id = ret;
|
||||
@ -462,9 +462,9 @@ static int rpmsg_chrdev_eptdev_add(struct rpmsg_eptdev *eptdev, struct rpmsg_cha
|
||||
return ret;
|
||||
|
||||
free_ept_ida:
|
||||
ida_simple_remove(&rpmsg_ept_ida, dev->id);
|
||||
ida_free(&rpmsg_ept_ida, dev->id);
|
||||
free_minor_ida:
|
||||
ida_simple_remove(&rpmsg_minor_ida, MINOR(dev->devt));
|
||||
ida_free(&rpmsg_minor_ida, MINOR(dev->devt));
|
||||
free_eptdev:
|
||||
put_device(dev);
|
||||
kfree(eptdev);
|
||||
|
@ -605,7 +605,7 @@ static void rpmsg_dev_remove(struct device *dev)
|
||||
rpmsg_destroy_ept(rpdev->ept);
|
||||
}
|
||||
|
||||
static struct bus_type rpmsg_bus = {
|
||||
static const struct bus_type rpmsg_bus = {
|
||||
.name = "rpmsg",
|
||||
.match = rpmsg_dev_match,
|
||||
.dev_groups = rpmsg_dev_groups,
|
||||
|
@ -130,8 +130,8 @@ static void rpmsg_ctrldev_release_device(struct device *dev)
|
||||
{
|
||||
struct rpmsg_ctrldev *ctrldev = dev_to_ctrldev(dev);
|
||||
|
||||
ida_simple_remove(&rpmsg_ctrl_ida, dev->id);
|
||||
ida_simple_remove(&rpmsg_minor_ida, MINOR(dev->devt));
|
||||
ida_free(&rpmsg_ctrl_ida, dev->id);
|
||||
ida_free(&rpmsg_minor_ida, MINOR(dev->devt));
|
||||
kfree(ctrldev);
|
||||
}
|
||||
|
||||
@ -156,12 +156,12 @@ static int rpmsg_ctrldev_probe(struct rpmsg_device *rpdev)
|
||||
cdev_init(&ctrldev->cdev, &rpmsg_ctrldev_fops);
|
||||
ctrldev->cdev.owner = THIS_MODULE;
|
||||
|
||||
ret = ida_simple_get(&rpmsg_minor_ida, 0, RPMSG_DEV_MAX, GFP_KERNEL);
|
||||
ret = ida_alloc_max(&rpmsg_minor_ida, RPMSG_DEV_MAX - 1, GFP_KERNEL);
|
||||
if (ret < 0)
|
||||
goto free_ctrldev;
|
||||
dev->devt = MKDEV(MAJOR(rpmsg_major), ret);
|
||||
|
||||
ret = ida_simple_get(&rpmsg_ctrl_ida, 0, 0, GFP_KERNEL);
|
||||
ret = ida_alloc(&rpmsg_ctrl_ida, GFP_KERNEL);
|
||||
if (ret < 0)
|
||||
goto free_minor_ida;
|
||||
dev->id = ret;
|
||||
@ -179,9 +179,9 @@ static int rpmsg_ctrldev_probe(struct rpmsg_device *rpdev)
|
||||
return ret;
|
||||
|
||||
free_ctrl_ida:
|
||||
ida_simple_remove(&rpmsg_ctrl_ida, dev->id);
|
||||
ida_free(&rpmsg_ctrl_ida, dev->id);
|
||||
free_minor_ida:
|
||||
ida_simple_remove(&rpmsg_minor_ida, MINOR(dev->devt));
|
||||
ida_free(&rpmsg_minor_ida, MINOR(dev->devt));
|
||||
free_ctrldev:
|
||||
put_device(dev);
|
||||
kfree(ctrldev);
|
||||
|
Loading…
Reference in New Issue
Block a user