lkml.org 
[lkml]   [2016]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V2 08/10] watchdog: da9062/61: watchdog driver
Date
On 26 October 2016 19:59 Guenter Roeck wrote:

> On Wed, Oct 26, 2016 at 05:56:39PM +0100, Steve Twiss wrote:
> > From: Steve Twiss <stwiss.opensource@diasemi.com>
> >
> > +static const struct of_device_id da9062_compatible_id_table[] = {
> > + { .compatible = "dlg,da9062-watchdog", .data = &da9062_watchdog_info },
> > + { },
> > +};
> > +
> > static int da9062_wdt_probe(struct platform_device *pdev)
> > {
> > int ret;
> > struct da9062 *chip;
> > struct da9062_watchdog *wdt;
> > + const struct of_device_id *match;
> >
> > chip = dev_get_drvdata(pdev->dev.parent);
> > if (!chip)
> > return -EINVAL;
> >
> > + match = of_match_node(da9062_compatible_id_table,
> > + pdev->dev.of_node);
> > + if (!match)
> > + return -ENXIO;
> > +
> > wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
> > if (!wdt)
> > return -ENOMEM;
> >
> > wdt->hw = chip;
> >
> > - wdt->wdtdev.info = &da9062_watchdog_info;
> > + wdt->wdtdev.info = (const struct watchdog_info *)match->data;
>
> I don't see why you would need match->data or of_match_node above.

Hi Guenter,

True. I do not need to do any matching on the table any more if the assumption is
to use a fall-back compatible string for DA9061 devices (to use the da9062 device
driver).

I can erase most of that content. Including the .data = &da9062_watchdog_info.

Regards,
Steve

\
 
 \ /
  Last update: 2016-10-27 16:00    [W:0.053 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site