linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/8] ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets
Date: Sat, 14 Feb 2015 18:09:39 +0100	[thread overview]
Message-ID: <20150214170939.GG3213@lunn.ch> (raw)
In-Reply-To: <E1YMedG-00054d-0d@rmk-PC.arm.linux.org.uk>

Hi Russell

> +static struct reset_control_ops pmu_reset_ops = {
> +	.reset = pmu_reset_reset,
> +	.assert = pmu_reset_assert,
> +	.deassert = pmu_reset_deassert,
> +};
> +
> +static struct reset_controller_dev pmu_reset __initdata = {
> +	.ops = &pmu_reset_ops,
> +	.owner = THIS_MODULE,

Dumb question: Is this still needed? There have been a lot of patches
from Wolfram Sang removing similar THIS_MODULE statements.

> + * pmu {
> + *	compatible = "marvell,pmu";

Is this maybe too generic? I'm sure Marvell has more than one pmu.
Maybe "marvell,dove-pmu"

> +int __init dove_init_pmu(void)
> +{
> +	struct device_node *np_pmu, *np;
> +	struct pmu_data *pmu;
> +	int ret, parent_irq;
> +
> +	/* Lookup the PMU node */
> +	np_pmu = of_find_compatible_node(NULL, NULL, "marvell,pmu");
> +	if (!np_pmu)
> +		return 0;
> +
> +	pmu = kzalloc(sizeof(*pmu), GFP_KERNEL);
> +	if (!pmu)
> +		return -ENOMEM;
> +
> +	spin_lock_init(&pmu->lock);
> +	pmu->of_node = np_pmu;
> +	pmu->pmc_base = of_iomap(pmu->of_node, 0);
> +	pmu->pmu_base = of_iomap(pmu->of_node, 1);
> +	if (!pmu->pmc_base || !pmu->pmu_base) {
> +		pr_err("%s: failed to map PMU\n", np_pmu->name);
> +		iounmap(pmu->pmu_base);
> +		iounmap(pmu->pmc_base);
> +		kfree(pmu);
> +		return -ENOMEM;
> +	}
> +
> +	parent_irq = irq_of_parse_and_map(pmu->of_node, 0);
> +	if (!parent_irq)
> +		pr_err("%s: no interrupt specified\n", np_pmu->name);
> +

Is it not fatal to be missing the interrupt? Seems like return -EINVAL
would be a good idea?

      Andrew

  parent reply	other threads:[~2015-02-14 17:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14 15:26 [FOR DISCUSSION 0/8] Dove PMU support Russell King - ARM Linux
2015-02-14 15:27 ` [PATCH 4/8] ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets Russell King
2015-02-14 17:02   ` Sebastian Hesselbarth
2015-02-15 16:36     ` Russell King - ARM Linux
2015-02-16 15:58     ` Russell King - ARM Linux
2015-02-16 16:30       ` Sebastian Hesselbarth
2015-02-16 16:52         ` Russell King - ARM Linux
2015-02-16 17:54           ` Andrew Lunn
2015-02-14 17:09   ` Andrew Lunn [this message]
2015-02-15 16:26     ` Russell King - ARM Linux
2015-02-14 15:27 ` [PATCH 5/8] ARM: dt: dove: add Dove PMU DT entry to dove.dtsi Russell King
2015-02-14 15:27 ` [PATCH 6/8] ARM: dt: dove: wire up RTC interrupt Russell King
2015-02-14 15:28 ` [PATCH 7/8] ARM: dt: dove: add video decoder power domain description Russell King
2015-02-14 15:28 ` [PATCH 8/8] ARM: dt: dove: add GPU " Russell King
2015-02-14 16:49 ` [FOR DISCUSSION 0/8] Dove PMU support Andrew Lunn

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=20150214170939.GG3213@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).