From 9f47b1cbb3937be19b543dbace1efa3d9354ea2b Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Fri, 11 Jan 2013 14:37:08 -0800 Subject: [PATCH] gpio: sx150x: Drop address from copyright header Signed-off-by: Stephen Boyd --- drivers/gpio/gpio-sx150x.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index a4f73534394e..93b94bd379cf 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c @@ -8,11 +8,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA. */ #include #include @@ -189,9 +184,9 @@ static int sx150x_get_io(struct sx150x_chip *chip, unsigned offset) return err; } -static void sx150x_set_oscio(struct sx150x_chip *chip, int val) +static s32 sx150x_set_oscio(struct sx150x_chip *chip, int val) { - sx150x_i2c_write(chip->client, + return sx150x_i2c_write(chip->client, chip->dev_cfg->reg_clock, (val ? 0x1f : 0x10)); } @@ -286,11 +281,13 @@ static int sx150x_gpio_direction_output(struct gpio_chip *gc, chip = container_of(gc, struct sx150x_chip, gpio_chip); - if (!offset_is_oscio(chip, offset)) { - mutex_lock(&chip->lock); + mutex_lock(&chip->lock); + if (offset_is_oscio(chip, offset)) + status = sx150x_set_oscio(chip, val); + else status = sx150x_io_output(chip, offset, val); - mutex_unlock(&chip->lock); - } + mutex_unlock(&chip->lock); + return status; }