Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp947624rwe; Wed, 31 Aug 2022 14:06:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR7vUcfaMRWGuKBNL5rv6otqBUvNrjyK/3s38nywPcnz/tVwUij+155JbDtzFymFMUczGI+T X-Received: by 2002:a17:906:9be4:b0:741:480a:387a with SMTP id de36-20020a1709069be400b00741480a387amr14951613ejc.147.1661979995357; Wed, 31 Aug 2022 14:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661979995; cv=none; d=google.com; s=arc-20160816; b=wfxUrVeGZGcxKRhJHt4lacefVYfkhLmAMW9oZH6VkinlYtDdx1KLSAFVdNmt1tFmUm CNjGyf4rKQNOF9kd8xHn3SXRdTSSP6GfNT7xT2aj/Tl46LWfGPXl3O9FqzGbl4MXEDO8 aCgBKXjB6zFRgRPegCA4Zo19juhSu7PdlqISuQl3iQpZ6d9jGi6GavCLxqbVodh9yxlr xAlYnoY8pcidIzf5//ZHJ1DRciOqFZyvvyoVNcKoEYbPtJfY4xoBHak7P7ucczOAwxHG Nebthci6PFADKrQ9uooexQC/JIT31M8m9f2zj11CM7oAX5Tx1slHAzM46V9zJ9ugvKvz Unww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Lm/RZPLIEmhN/LnLDqED8T5kNeYPJ9ZE7keo9L2XblM=; b=V7iMDfqejMQ21NnUUHdgxwawusoVi6Py9MLk84BfecKXNuSeWnd+nV7bXXkyarEvMd 9YHiaqpihJGzSACCva8JUHFCnuLZ0+VyNBjFFrXZgF9tXjmUigs8ElZOqOMl6yB4gozv 5fZLB5q1NB6BitWSPPqKoLopY/Ncw/EGWv873txBm6jYsA94dGMYvvZvRnw4jWqu73f3 Zv0REL/XkGv8DxILcYM/NRSwOdw02u/IW+6SWyJi0jL9n0nLYTNrZOu6F4aWw0NW8xAK CaM4rtKmdh1GUhEM2qnc5Gbr2T0k8ncr+dZd/rGCQYtV0l3YKu8iF0mgRCK/1QewxTjz MCWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="PmuB/9nT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y25-20020a50e619000000b0044838667a9fsi188060edm.357.2022.08.31.14.06.10; Wed, 31 Aug 2022 14:06:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="PmuB/9nT"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231210AbiHaUzZ (ORCPT + 99 others); Wed, 31 Aug 2022 16:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbiHaUzY (ORCPT ); Wed, 31 Aug 2022 16:55:24 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A71DB4AD66; Wed, 31 Aug 2022 13:55:22 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id f9so8365134qvw.11; Wed, 31 Aug 2022 13:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Lm/RZPLIEmhN/LnLDqED8T5kNeYPJ9ZE7keo9L2XblM=; b=PmuB/9nTT9x1QYVnWHyg18mcUdWMq+Af9waq//SgtjYz9TkDLLBaA6WYAicusMS1l2 ldmx8FvWX1LREyEh8fTaH2lmFRpAi7mOsppLEA3Hl3h/1fjIGy6bWbL8/sT57Qz+OLoz MEeBY7eFFKy8u6IQEyKX2VROVtCrzcq//48Y9EaF2OlHPo0jmW4UWU+Z+Zc+4/3oD7gH JOa5yVc5Qr+eb7CVEvxBtfodvNhfKp3mXxtwzWHjnhSJxG/tq5b4DvGO+9LNnvDAQgDz vC+HWRaAQMys9o83GviYRKEb6t+XFoaSe5LdIhpURT08Ff/DcPeNXYY8NAM5JbP9S3ca hPNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Lm/RZPLIEmhN/LnLDqED8T5kNeYPJ9ZE7keo9L2XblM=; b=lE3kbPXYp4bnfbFLyMhgUHwKgkHB+j7MVWKRaRXe26OVRlLAK3gUSOE/Jzz0AT1niz so7ApTBMqCF+vG6yuAtZ+ZextWI/YXeOOVz61NF5YZfDuiwoPEHGxgb4d9RO22g6WD1f Em67RUwgSQ9A5hrQu21goVtP9mr5PwAB7FvUaLeA9kDqboFOmNNhfjwbAQG9xINgU3VD 03DNnZ6hiYJR0648QgxzvcI2FCNEL+ujO/dReshV+WfaA77xAKhmUSGpS1p0kXwPz5RN Gu0WZhs2FmM6GJtBP70PNTN2ozJiMuWl2JUdc+sKmF4J5DP2AnFnKKh7f6cuvow6GSW/ REVA== X-Gm-Message-State: ACgBeo2YZfbz0pgRP2eBuL5/cSrE2G7u+/QnwEGnQMkj+eX1KYi8Tepi Yd0Uz3i5zy5AwJjNJuZo7eMZCrTBDIFpsYXGPZM= X-Received: by 2002:a05:6214:c8f:b0:499:21eb:ba3b with SMTP id r15-20020a0562140c8f00b0049921ebba3bmr2933878qvr.97.1661979321767; Wed, 31 Aug 2022 13:55:21 -0700 (PDT) MIME-Version: 1.0 References: <20220829133923.1114555-1-martyn.welch@collabora.com> <20220829133923.1114555-3-martyn.welch@collabora.com> In-Reply-To: <20220829133923.1114555-3-martyn.welch@collabora.com> From: Andy Shevchenko Date: Wed, 31 Aug 2022 23:54:45 +0300 Message-ID: Subject: Re: [PATCH 3/5] gpio: pca953x: Fix pca953x_gpio_set_pull_up_down() To: Martyn Welch Cc: Linus Walleij , Bartosz Golaszewski , Collabora Kernel ML , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 29, 2022 at 4:43 PM Martyn Welch wrote: > > A previous fix (dc87f6dd058a gpio: pca953x: Fix pca953x_gpio_set_config) Format is wrong. Please read documentation on how to refer to the commits in the tree. > identified that pinconf_to_config_param() needed to be used to isolate > the config_param from the pinconf in pca953x_gpio_set_config(). This fix > however did not consider that this would also be needed in > pca953x_gpio_set_pull_up_down() to which it passes this config. > > Perform a similar call in pca953x_gpio_set_pull_up_down() to isolate the > configuration parameter there as well, rather than passing it from > pca953x_gpio_set_config() as the configuration argument may also be needed > in pca953x_gpio_set_pull_up_down() at a later date. ... > u8 pull_en_reg = pca953x_recalc_addr(chip, PCAL953X_PULL_EN, offset); > u8 pull_sel_reg = pca953x_recalc_addr(chip, PCAL953X_PULL_SEL, offset); > u8 bit = BIT(offset % BANK_SZ); > + enum pin_config_param param = pinconf_to_config_param(config); I would move it up before the u8 variable. The code looks good otherwise. Reviewed-by: Andy Shevchenko Thanks for fixing this! -- With Best Regards, Andy Shevchenko