linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Markus Pargmann <mpa@pengutronix.de>
Cc: Wim Van Sebroeck <wim@iguana.be>,
	Support Opensource <support.opensource@diasemi.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH v3] watchdog: Add DA906x PMIC watchdog driver.
Date: Thu, 14 Aug 2014 08:40:10 -0700	[thread overview]
Message-ID: <53ECD85A.8050903@roeck-us.net> (raw)
In-Reply-To: <20140814095733.GG17027@pengutronix.de>

On 08/14/2014 02:57 AM, Markus Pargmann wrote:

>>> +
>>> +static int da9063_wdt_probe(struct platform_device *pdev)
>>> +{
>>> +	int ret;
>>> +	struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent);
>>> +	struct da9063_watchdog *wdt;
>>> +
>>> +	if (!da9063)
>>> +		return -EPROBE_DEFER;
>>
>> Can this ever happen ? Isn't this driver instantiated from its parent,
>> which would ensure that the parent's driver data is set ?
>
> No this can't happen. I replaced it with BUG_ON and also introduced a
> BUG_ON check for dev.parent.
>
That is a bit too much. You should only use BUG_ON if the kernel can not
continue to run, which should not be the case here. I would suggest
to return -ENODEV.

Guenter


  reply	other threads:[~2014-08-14 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13 10:46 [PATCH v3] watchdog: Add DA906x PMIC watchdog driver Markus Pargmann
2014-08-13 10:50 ` Markus Pargmann
2014-08-14  5:26 ` Guenter Roeck
2014-08-14  9:57   ` Markus Pargmann
2014-08-14 15:40     ` Guenter Roeck [this message]
2014-08-15  8:51       ` Markus Pargmann

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=53ECD85A.8050903@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mpa@pengutronix.de \
    --cc=p.zabel@pengutronix.de \
    --cc=support.opensource@diasemi.com \
    --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).