X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fmailbox%2Fmailbox-uclass.c;h=1b4a5863c9e5c3a24989e2ca61145e80da996c4e;hb=a4aa7bef3c66e473ab4671b0edef1bb66488a032;hp=a7fcde51d593a105a3f49db713993958b533bea8;hpb=78ad7157886badef2d69e264c366dbdd2eac040f;p=u-boot diff --git a/drivers/mailbox/mailbox-uclass.c b/drivers/mailbox/mailbox-uclass.c index a7fcde51d5..1b4a5863c9 100644 --- a/drivers/mailbox/mailbox-uclass.c +++ b/drivers/mailbox/mailbox-uclass.c @@ -1,24 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2016, NVIDIA CORPORATION. - * - * SPDX-License-Identifier: GPL-2.0 */ #include #include -#include #include #include -DECLARE_GLOBAL_DATA_PTR; - static inline struct mbox_ops *mbox_dev_ops(struct udevice *dev) { return (struct mbox_ops *)dev->driver->ops; } static int mbox_of_xlate_default(struct mbox_chan *chan, - struct fdtdec_phandle_args *args) + struct ofnode_phandle_args *args) { debug("%s(chan=%p)\n", __func__, chan); @@ -34,24 +30,22 @@ static int mbox_of_xlate_default(struct mbox_chan *chan, int mbox_get_by_index(struct udevice *dev, int index, struct mbox_chan *chan) { - struct fdtdec_phandle_args args; + struct ofnode_phandle_args args; int ret; struct udevice *dev_mbox; struct mbox_ops *ops; debug("%s(dev=%p, index=%d, chan=%p)\n", __func__, dev, index, chan); - ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev->of_offset, - "mboxes", "#mbox-cells", 0, - index, &args); + ret = dev_read_phandle_with_args(dev, "mboxes", "#mbox-cells", 0, index, + &args); if (ret) { - debug("%s: fdtdec_parse_phandle_with_args failed: %d\n", - __func__, ret); + debug("%s: dev_read_phandle_with_args failed: %d\n", __func__, + ret); return ret; } - ret = uclass_get_device_by_of_offset(UCLASS_MAILBOX, args.node, - &dev_mbox); + ret = uclass_get_device_by_ofnode(UCLASS_MAILBOX, args.node, &dev_mbox); if (ret) { debug("%s: uclass_get_device_by_of_offset failed: %d\n", __func__, ret); @@ -85,8 +79,7 @@ int mbox_get_by_name(struct udevice *dev, const char *name, debug("%s(dev=%p, name=%s, chan=%p)\n", __func__, dev, name, chan); - index = fdt_stringlist_search(gd->fdt_blob, dev->of_offset, - "mbox-names", name); + index = dev_read_stringlist_search(dev, "mbox-names", name); if (index < 0) { debug("fdt_stringlist_search() failed: %d\n", index); return index;