public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Fuzzey <mfuzzey@parkeon.com>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer)
Date: Mon, 04 Jan 2016 19:17:08 +0100	[thread overview]
Message-ID: <20160104181708.10572.81323.stgit@localhost> (raw)

Normally, when a platform driver defines a .probe callback, the
result of dev_pm_domain_attach() is ignored unless it is EPROBE_DEFER.

However, when a .probe callback is not defined the result of
dev_pm_domain_attach() is propagated to the caller.

But dev_pm_domain_attach() can return -ENODEV for devices with no
power domain.

This was causing the alarmtimer .suspend() callback to be ignored
and hence alarms not to wake from suspend (since the RTC was
not being programmed on suspend).

Fixes: b8b2c7d [base/platform: assert that dev_pm_domain callbacks are called unconditionally]
Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
---
 drivers/base/platform.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1dd6d3b..61e5b7e 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -513,8 +513,8 @@ static int platform_drv_probe(struct device *_dev)
 		return ret;
 
 	ret = dev_pm_domain_attach(_dev, true);
-	if (ret != -EPROBE_DEFER && drv->probe) {
-		ret = drv->probe(dev);
+	if (ret != -EPROBE_DEFER) {
+		ret = drv->probe ? drv->probe(dev) : 0;
 		if (ret)
 			dev_pm_domain_detach(_dev, true);
 	}


             reply	other threads:[~2016-01-04 18:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 18:17 Martin Fuzzey [this message]
2016-01-05  8:43 ` [PATCH] base/platform: Fix platform drivers with no probe callback (ex alarmtimer) Uwe Kleine-König
2016-01-05 10:02   ` Tero Roponen
2016-01-05 13:02     ` Uwe Kleine-König
2016-01-05 11:14   ` Martin Fuzzey

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=20160104181708.10572.81323.stgit@localhost \
    --to=mfuzzey@parkeon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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