Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp651434ybz; Wed, 15 Apr 2020 15:59:44 -0700 (PDT) X-Google-Smtp-Source: APiQypLbOVQHr4sc4WVLCuErpAAgqd/YstjC51t0PAOfQpVPBGTdVevxcqdD8HycwBQdSiOF9z3Y X-Received: by 2002:a17:907:9481:: with SMTP id dm1mr7372418ejc.9.1586991584238; Wed, 15 Apr 2020 15:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586991584; cv=none; d=google.com; s=arc-20160816; b=ChxOJkeegUyJp7jqzpBFkNVTjsMx3ULn4aJF0doAuuD2aQ4LgPEIDOHfV4Fjcz4i2e SiVLZtZ9+LTOdw6YOxWbuI6kBxF1wZTtLvX6HanBo0FkuKy2+yXGutub18McwuQ/x2sB rzyD791exyMBVNy8fy/H43IRgL9sERu6r+ENTBQEWdW2IjRJiSdBV+uB0/CWlNwp61ow F9xue7b4LYORie+g9GC3PRc+pe6j6wYDSeGsxmVgqmXjHuYyJjDOo63jNb430A5UPkAv eX3isEN0Pn9Q761OP4SEdr43kFkIYk+J92/sai2uDMb/KFdbxAw1g81JjWsjPfd0teql sf+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wOmETXgpnR0UiiTfkrMXsqOFBsXGlBK6YD0CLMuo+FM=; b=DL4HtZaO2ef5mA3U7zGd3KN35KmW33TZ1aMpNumhsglD0/nMtJjZePEQ3pPx5KthJx x+ba5UotmNgZPTxjoqMmemCyb3mvjKc1MOTHjh8aJdnfR0I0IMK5NaHQCH+zd3Icj/Sq 6Ljj3qaeXh+VO1vE4tgz37EU4iBAAIEJsas8klmOiRcdxfIeL6OBPXg6uk5sw5Q/GX6Z VwzHwKg2wLnS1HvbcIsNODmRgwLEPSkcdgIseTWuPMrQ0SqL0AydZNjoi6fK8x37a4/P 7pd3j2TdXRw8agbCzNPXkL9zrLN5xYrB4AmQ52BgWS9nCGysyszx+pwgeSO4/Ga7J3tb IP1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=TiFg00+L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si11448083ejb.157.2020.04.15.15.59.20; Wed, 15 Apr 2020 15:59:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=TiFg00+L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896915AbgDOLYt (ORCPT + 99 others); Wed, 15 Apr 2020 07:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2896922AbgDOLYG (ORCPT ); Wed, 15 Apr 2020 07:24:06 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3D19C061A0C for ; Wed, 15 Apr 2020 04:24:03 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id l13so10084675qtr.7 for ; Wed, 15 Apr 2020 04:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=wOmETXgpnR0UiiTfkrMXsqOFBsXGlBK6YD0CLMuo+FM=; b=TiFg00+LOB+J3ECZHXf1hg6toq17QIQNzCBw5JV2NofPJ4885HzqlLS011N8RRjqry JHrm5gPSFF43Kf55r43lWDgtWNHGhz9ongDMeQzmAitEb5B50AVgeeJwZveyL8rTyHH8 GHmnSqOgREGSdTq1E+fj8JqySTyiyxhUvKuxDn5T0sBne4FdayoiEvawk3KmttWfTNq6 CxxY5tgKjqBw/x2S6ihccX8mwsEheruVwN57zisJ+krwhxnKKLnECu/MHxFf9r8D4iAB RXpEAa5k7KSEyE4W4CnbwLmkccYFkHGzGgNa2FY9e6UCHHBwqve49mz1yGxapotc1APH 3YpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wOmETXgpnR0UiiTfkrMXsqOFBsXGlBK6YD0CLMuo+FM=; b=YG9dKJJ58NcxRKkgtb8/l02TFWSsz0ZdRPsFeCNfSwmoiRmqlHfNIGpdlHnbdhTrBw fVAtvTiu9vel6Qx0OQelsjey3/3+u2ZdSPVkL6IMS46cpkWjFZowggo3grIK+sFLxRZR JP5W5fNogYlqRleQ0w0xEmzZYDpSBFvjZfdkAer6375+DynRxEfDTmmMh7HcVOIJwPXi y8zVZ6kMb+fiuq6JRRAM8ZJ67mi6mqfdB/ViB92t9j0mIxcy5NlrC8LNq/WA/Qa5E+zp p6BLWAFL8Ek9amZs1gc7SI7dFFkrlTmYL3o5It+Nw73xHn0OCpBJalJx5CjtN2DGMUHx yqdQ== X-Gm-Message-State: AGi0PubQ1SSpmq23FFH6atWJGSuIS0asObYw5FM7sVJtpfLqnSEmDh46 TgYKDZ9T4H6tZ1Y3Zox2zlwZC5SnUljXdZaBpBBNig== X-Received: by 2002:ac8:5209:: with SMTP id r9mr2900056qtn.57.1586949843116; Wed, 15 Apr 2020 04:24:03 -0700 (PDT) MIME-Version: 1.0 References: <20200412013352.674506-1-aford173@gmail.com> <20200412013352.674506-2-aford173@gmail.com> In-Reply-To: <20200412013352.674506-2-aford173@gmail.com> From: Bartosz Golaszewski Date: Wed, 15 Apr 2020 13:23:52 +0200 Message-ID: Subject: Re: [PATCH 2/2] gpio: pca953x: Fix pca953x_gpio_set_config To: Adam Ford Cc: linux-gpio , aford@beaconembedded.com, Linus Walleij , Thomas Petazzoni , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org niedz., 12 kwi 2020 o 03:34 Adam Ford napisa=C5=82(a): > > pca953x_gpio_set_config is setup to support pull-up/down > bias. Currently the driver uses a variable called 'config' to > determine which options to use. Unfortunately, this is incorrect. > > This patch uses function pinconf_to_config_param(config), which > converts this 'config' parameter back to pinconfig to determine > which option to use. > > Fixes: 15add06841a3 ("gpio: pca953x: add ->set_config implementation") > > Signed-off-by: Adam Ford > > diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c > index 5638b4e5355f..4269ea9a817e 100644 > --- a/drivers/gpio/gpio-pca953x.c > +++ b/drivers/gpio/gpio-pca953x.c > @@ -531,7 +531,7 @@ static int pca953x_gpio_set_config(struct gpio_chip *= gc, unsigned int offset, > { > struct pca953x_chip *chip =3D gpiochip_get_data(gc); > > - switch (config) { > + switch (pinconf_to_config_param(config)) { > case PIN_CONFIG_BIAS_PULL_UP: > case PIN_CONFIG_BIAS_PULL_DOWN: > return pca953x_gpio_set_pull_up_down(chip, offset, config= ); > -- > 2.25.1 > Patch applied for fixes, thanks! Bart