public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	"Benoît Cousson" <bcousson@baylibre.com>,
	devicetree@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Nishanth Menon" <nm@ti.com>,
	"Matthijs van Duin" <matthijsvanduin@gmail.com>,
	"Paul Walmsley" <paul@pwsan.com>,
	"Peter Ujfalusi" <peter.ujfalusi@ti.com>,
	"Sakari Ailus" <sakari.ailus@iki.fi>,
	"Tero Kristo" <t-kristo@ti.com>,
	"Tomi Valkeinen" <tomi.valkeinen@ti.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/7] bus: ti-sysc: Add minimal TI sysc interconnect target driver
Date: Fri, 13 Oct 2017 10:51:44 -0700	[thread overview]
Message-ID: <20171013175144.GQ4394@atomide.com> (raw)
In-Reply-To: <20170929223411.9691-5-tony@atomide.com>

* Tony Lindgren <tony@atomide.com> [170929 15:35]:
> +static struct platform_driver sysc_driver = {
> +	.probe		= sysc_probe,
> +	.driver         = {
> +		.name   = "ti-sysc",
> +		.of_match_table	= sysc_match,
> +		.pm = &sysc_pm_ops,
> +	},
> +};
> +module_platform_driver(sysc_driver);

We also need add remove() to have unbind and bind work
properly, here's an incremental patch to add that.

Regards,

Tony

8< -------------------------
>From tony Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Fri, 13 Oct 2017 10:48:40 -0700
Subject: [PATCH] bus: ti-sysc: Fix unbalanced pm_runtime_enable by adding
 remove

Looks like we're missing remove() that's needed if a driver instance
rebound. Otherwise we will get "Unbalanced pm_runtime_enable!".

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/bus/ti-sysc.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -529,6 +529,30 @@ static int sysc_probe(struct platform_device *pdev)
 	return error;
 }
 
+static int sysc_remove(struct platform_device *pdev)
+{
+	struct sysc *ddata = platform_get_drvdata(pdev);
+	int error;
+
+	error = pm_runtime_get_sync(ddata->dev);
+	if (error < 0) {
+		pm_runtime_put_noidle(ddata->dev);
+		pm_runtime_disable(ddata->dev);
+		goto unprepare;
+	}
+
+	of_platform_depopulate(&pdev->dev);
+
+	pm_runtime_dont_use_autosuspend(&pdev->dev);
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+
+unprepare:
+	sysc_unprepare(ddata);
+
+	return 0;
+}
+
 static const struct of_device_id sysc_match[] = {
 	{ .compatible = "ti,sysc-omap2" },
 	{ .compatible = "ti,sysc-omap4" },
@@ -546,6 +570,7 @@ MODULE_DEVICE_TABLE(of, sysc_match);
 
 static struct platform_driver sysc_driver = {
 	.probe		= sysc_probe,
+	.remove		= sysc_remove,
 	.driver         = {
 		.name   = "ti-sysc",
 		.of_match_table	= sysc_match,
-- 
2.14.2

      reply	other threads:[~2017-10-13 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170929223411.9691-1-tony@atomide.com>
2017-09-29 22:34 ` [PATCH 4/7] bus: ti-sysc: Add minimal TI sysc interconnect target driver Tony Lindgren
2017-10-13 17:51   ` Tony Lindgren [this message]

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=20171013175144.GQ4394@atomide.com \
    --to=tony@atomide.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=matthijsvanduin@gmail.com \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=sakari.ailus@iki.fi \
    --cc=t-kristo@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /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