summaryrefslogtreecommitdiff
path: root/drivers/watchdog/meson_wdt.c
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-04-01 05:25:21 +0300
committerWim Van Sebroeck <wim@linux-watchdog.org>2021-06-21 09:49:05 +0300
commit0a1186e49b010b4ecdcc60dd356b5751d7642dd4 (patch)
tree621bc85ce5e38b8347b14eab83d4d39bb78c707f /drivers/watchdog/meson_wdt.c
parentc891ef7d80da1855b5bba478a564c184df314ea4 (diff)
downloadlinux-0a1186e49b010b4ecdcc60dd356b5751d7642dd4.tar.xz
watchdog: meson_wdt: Use device_get_match_data() helper
Use the device_get_match_data() helper instead of open coding. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/1617243921-56774-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog/meson_wdt.c')
-rw-r--r--drivers/watchdog/meson_wdt.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/watchdog/meson_wdt.c b/drivers/watchdog/meson_wdt.c
index 459f3ae02c91..539feaa1f904 100644
--- a/drivers/watchdog/meson_wdt.c
+++ b/drivers/watchdog/meson_wdt.c
@@ -162,7 +162,6 @@ static int meson_wdt_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct meson_wdt_dev *meson_wdt;
- const struct of_device_id *of_id;
int err;
meson_wdt = devm_kzalloc(dev, sizeof(*meson_wdt), GFP_KERNEL);
@@ -173,12 +172,7 @@ static int meson_wdt_probe(struct platform_device *pdev)
if (IS_ERR(meson_wdt->wdt_base))
return PTR_ERR(meson_wdt->wdt_base);
- of_id = of_match_device(meson_wdt_dt_ids, dev);
- if (!of_id) {
- dev_err(dev, "Unable to initialize WDT data\n");
- return -ENODEV;
- }
- meson_wdt->data = of_id->data;
+ meson_wdt->data = device_get_match_data(dev);
meson_wdt->wdt_dev.parent = dev;
meson_wdt->wdt_dev.info = &meson_wdt_info;