lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 27 Oct 2016 13:10:24 +0000
From:   Steve Twiss <stwiss.opensource@...semi.com>
To:     Guenter Roeck <linux@...ck-us.net>
CC:     LINUX-KERNEL <linux-kernel@...r.kernel.org>,
        LINUX-WATCHDOG <linux-watchdog@...r.kernel.org>,
        Wim Van Sebroeck <wim@...ana.be>,
        DEVICETREE <devicetree@...r.kernel.org>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        LINUX-INPUT <linux-input@...r.kernel.org>,
        "Rob Herring" <robh+dt@...nel.org>
Subject: RE: [PATCH V2 08/10] watchdog: da9062/61: watchdog driver

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@...semi.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ