public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: ashishj3 <ashish.jangam@kpitcummins.com>
Cc: sameo@openedhand.com, linux-kernel@vger.kernel.org,
	Dajun <dajun.chen@diasemi.com>,
	linaro-dev@lists.linaro.org, arnd@arndb.de
Subject: Re: [PATCH 01/11] MFD: DA9052/53 MFD core module v4
Date: Fri, 19 Aug 2011 01:18:13 +0900	[thread overview]
Message-ID: <20110818161811.GC20208@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1313675603.4108.151.camel@L-0532.kpit.com>

On Thu, Aug 18, 2011 at 07:23:22PM +0530, ashishj3 wrote:

> +int da9052_reg_read(struct da9052 *da9052, unsigned char reg)
> +{
> +	int val, ret;
> +
> +	if (reg > DA9052_MAX_REG_CNT) {
> +		dev_err(da9052->dev, "invalid reg %x\n", reg);
> +		return -EINVAL;
> +	}
> +
> +	if (da9052->bustype == BUS_SPI)
> +		reg = (reg << 1) | 1;

The same comment I made last time applies now: this isn't something that
should be being handled at the driver level.

For all your I/O functions there's not really any work going on in the
function except the translation from struct da9052 to the regmap it
points to.  May as well just turn the functions into inlines.

> +	if (events == 0)
> +		goto err;
> +
> +	for (i = 0; i < 32; i++) {
> +		if (events & (1 << i))
> +			handle_nested_irq(da9052->irq_base + i);
> +	}
> +
> +	da9052_group_write(da9052, DA9052_EVENT_A_REG, 4, v);
> +
> +	if (da9052->chip_id == DA9052 || da9052->chip_id == DA9053_AA)
> +		DA9052_FIXME();
> +
> +err:
> +	return IRQ_HANDLED;

If you hit an error you didn't handle an IRQ and so ought to be
returning IRQ_NONE.

      reply	other threads:[~2011-08-18 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18 13:53 [PATCH 01/11] MFD: DA9052/53 MFD core module v4 ashishj3
2011-08-18 16:18 ` Mark Brown [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=20110818161811.GC20208@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=arnd@arndb.de \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=dajun.chen@diasemi.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@openedhand.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