linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Twiss <stwiss.opensource@diasemi.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: LINUX-KERNEL <linux-kernel@vger.kernel.org>,
	LINUX-WATCHDOG <linux-watchdog@vger.kernel.org>,
	Wim Van Sebroeck <wim@iguana.be>,
	DEVICETREE <devicetree@vger.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	LINUX-INPUT <linux-input@vger.kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>
Subject: RE: [PATCH V2 08/10] watchdog: da9062/61: watchdog driver
Date: Thu, 27 Oct 2016 13:10:24 +0000	[thread overview]
Message-ID: <6ED8E3B22081A4459DAC7699F3695FB7018CCE6655@SW-EX-MBX02.diasemi.com> (raw)
In-Reply-To: <20161026185926.GA16142@roeck-us.net>

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

  reply	other threads:[~2016-10-27 13:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 16:56 [PATCH V2 00/10] da9061: DA9061 driver submission Steve Twiss
2016-10-26 16:56 ` [PATCH V2 02/10] Documentation: devicetree: watchdog: da9062/61 watchdog timer binding Steve Twiss
2016-10-31  4:17   ` Rob Herring
2016-10-26 16:56 ` [PATCH V2 01/10] Documentation: devicetree: input: additions for da9061 onkey driver Steve Twiss
2016-10-31  4:15   ` Rob Herring
2016-10-26 16:56 ` [PATCH V2 03/10] Documentation: devicetree: thermal: da9062/61 TJUNC temperature binding Steve Twiss
2016-11-29  0:59   ` Eduardo Valentin
2016-11-29 11:15     ` Steve Twiss
2016-10-26 16:56 ` [PATCH V2 05/10] mfd: da9061: MFD core support Steve Twiss
2016-11-11 10:37   ` Lee Jones
2016-11-11 15:50     ` Steve Twiss
2016-10-26 16:56 ` [PATCH V2 04/10] Documentation: devicetree: mfd: da9062/61 MFD binding Steve Twiss
2016-10-31  4:20   ` Rob Herring
2016-10-26 16:56 ` [PATCH V2 06/10] regulator: da9061: BUCK and LDO regulator driver Steve Twiss
2016-10-28 17:59   ` Mark Brown
2016-10-26 16:56 ` [PATCH V2 07/10] Input: da9061: onkey driver Steve Twiss
2016-10-26 22:50   ` Dmitry Torokhov
2016-10-26 16:56 ` [PATCH V2 08/10] watchdog: da9062/61: watchdog driver Steve Twiss
2016-10-26 18:59   ` Guenter Roeck
2016-10-27 13:10     ` Steve Twiss [this message]
2016-10-26 16:56 ` [PATCH V2 09/10] thermal: da9062/61: Thermal junction temperature monitoring driver Steve Twiss
2016-11-29  1:24   ` Eduardo Valentin
2016-11-29 11:11     ` Steve Twiss
2016-11-30  6:09       ` Eduardo Valentin
2016-12-15 19:06         ` Steve Twiss
2016-10-26 16:56 ` [PATCH V2 10/10] MAINTAINERS: da9062/61 updates to the Dialog Semiconductor search terms Steve Twiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ED8E3B22081A4459DAC7699F3695FB7018CCE6655@SW-EX-MBX02.diasemi.com \
    --to=stwiss.opensource@diasemi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh+dt@kernel.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).