Skip to content

Commit

Permalink
watchdog: mpc8xxx: make use of of_device_get_match_data
Browse files Browse the repository at this point in the history
This function is new in v4.2-rc1 and makes a forward declaration of the
match table superfluous which can so be removed.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Uwe Kleine-König authored and Wim Van Sebroeck committed Sep 9, 2015
1 parent 50ffb53 commit f0ded83
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/watchdog/mpc8xxx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ static struct watchdog_device mpc8xxx_wdt_dev = {
.ops = &mpc8xxx_wdt_ops,
};

static const struct of_device_id mpc8xxx_wdt_match[];
static int mpc8xxx_wdt_probe(struct platform_device *ofdev)
{
int ret;
Expand All @@ -150,10 +149,9 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev)
bool enabled;
unsigned int timeout_sec;

match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
if (!match)
wdt_type = of_device_get_match_data(&ofdev->dev);
if (!wdt_type)
return -EINVAL;
wdt_type = match->data;

if (!freq || freq == -1)
return -EINVAL;
Expand Down

0 comments on commit f0ded83

Please sign in to comment.