[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120802101952.GG29157@opensource.wolfsonmicro.com>
Date: Thu, 2 Aug 2012 11:19:52 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Anthony Olech <anthony.olech.opensource@...semi.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [NEW DRIVER V1 5/7] DA9058 GPIO driver
On Thu, Aug 02, 2012 at 09:48:57AM +0100, Anthony Olech wrote:
> + mutex_lock(&gpio->lock);
> + ret = da9058_reg_read(da9058, DA9058_STATUSC_REG, &gpio_level);
> + mutex_unlock(&gpio->lock);
regmap already does locking for you.
> + ret = da9058_reg_read(da9058, DA9058_GPIO0001_REG, &gpio_cntrl);
> + if (ret)
> + goto exit;
> +
> + if (offset) {
> + gpio_cntrl &= ~0xF0;
> + gpio_cntrl |= 0xF0 & gpio->out_config;
> +
> + ret = da9058_reg_write(da9058, DA9058_GPIO0001_REG, gpio_cntrl);
Just use regmap_update_bits().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists