From patchwork Sun May 14 16:59:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lizhe X-Patchwork-Id: 93737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6414182vqo; Sun, 14 May 2023 10:05:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7H29/YLX14n0BVT5vKWVJ4hCJVE+MbHcKi+uNNgWJrwJyxF42eD0cIWhbzACsUuD1asC+l X-Received: by 2002:a17:90a:c245:b0:250:69e4:9ed2 with SMTP id d5-20020a17090ac24500b0025069e49ed2mr23427455pjx.48.1684083944273; Sun, 14 May 2023 10:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684083944; cv=none; d=google.com; s=arc-20160816; b=g8LyKaVKelZKnRVNzoiBHAuSQwBoqMIaXnDcHa0EYgkiUQwj1gT6jFiOakZxLKoP/o VK/2XB2aqRmEtmVvA763LIbw+MnNga7yh5z+7DbzSwxvOi4dOXZpuzrOtXg3d7fD/YDa PFNQeF/DVuIwivjnbO69Re6sOjBZK8iC6eeDivU0a5jmM7atL92DmBaGqckEgcv1yN99 Va2ISvAcFrmrAOACxXReNYli6tU7tL0/nDhRxluj2UA2ktjxCiY9k/lveUOgfE0rltx8 d3KBPoa5+QZh0/+RpqRILkYc8Qv4rOqDai3+xtTgLR3bwNhXw6Sddl3ZECQ6xS3OpFAz N4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IENsND1np6J/rLyHblKjvAzLL1b2z/sAgmijvedzrLM=; b=MogtUrl6DAoCY8xwjpsZ8EGAnSDHWX4po3nly9ogmKkR9N+X4LrM/Xk03uROo3ME9K GwEf4WaxoDn4svtyIhz6vh30kNpiJEvvNNmmEuytDkb+W4DmNEGEl302ALD7sLcXfX5U mmLA1cnFWwVozCL/QX2RTnTykDkWaSgsK6hiwkLE19uOycfxiHwlHxQeRg7kGheO0yWn lMXz3LFYBFAZKpImPdbdv6s2iDzXdTIn3p5kxgiNCn/zUfnbjRm6Hkpln/Fn+3zNwlJL 78yfmKNFfGVIo8uY0ZlV/xLL3xg5Rg7SsW5bgaDU2WtehQT1+2mwLPjL269TpyTM+fKN 9ndw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=OQgMQLuF; 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=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a17090a01c600b0024ef1d1151bsi25775481pjd.17.2023.05.14.10.05.29; Sun, 14 May 2023 10:05:44 -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=@163.com header.s=s110527 header.b=OQgMQLuF; 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=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235718AbjENRAJ (ORCPT + 99 others); Sun, 14 May 2023 13:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjENRAI (ORCPT ); Sun, 14 May 2023 13:00:08 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E3B73A8F; Sun, 14 May 2023 10:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=IENsN D1np6J/rLyHblKjvAzLL1b2z/sAgmijvedzrLM=; b=OQgMQLuFxOPi2gynFpw7R EIrruI9dqi764WomABsUY3q1nsvOJETragCYY75b22Oi30+iqWcxnI5jfduEBymd Mc/vurOHOeIXtdscmHQX144HamLwZWVU9jbbe6jOA11Jhd6df4zX4AL6ow+ewRku GHTUjtSxvQCynB4NgDoMj4= Received: from lizhe.. (unknown [120.245.132.205]) by zwqz-smtp-mta-g3-2 (Coremail) with SMTP id _____wB3pRl2E2FkWM+gBw--.149S4; Mon, 15 May 2023 01:00:00 +0800 (CST) From: Lizhe To: linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Lizhe Subject: [PATCH v1] drivers/pinconf.c: Remove redundant check for the existence of the member Date: Mon, 15 May 2023 00:59:32 +0800 Message-Id: <20230514165932.251200-1-sensor1010@163.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CM-TRANSID: _____wB3pRl2E2FkWM+gBw--.149S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7ury5CryUurW5CFyfXry3twb_yoW8Gr47pa yfWr15Ar1rKFs8Ca1UGay0gFyYk3Z7GanrCw47tas3AF13AFyDArn5Kw4Iy34jkrn5uw1a q34ruFyY934kKFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zi1rWxUUUUU= X-Originating-IP: [120.245.132.205] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/xtbBlxBvq2I0ZA6V4wAAsJ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765889877958639594?= X-GMAIL-MSGID: =?utf-8?q?1765890005849085163?= "pin_config_set" in pinconf_ops. In the function of registering pinctrl_dev, pinctrl_init_controller(), a non-null check has already been performed on the members pin_config_set and pin_config_group_set in the ops structure. Signed-off-by: Lizhe --- drivers/pinctrl/pinconf.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index d9d54065472e..7b078d4ab61e 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c @@ -158,10 +158,6 @@ int pinconf_apply_setting(const struct pinctrl_setting *setting) switch (setting->type) { case PIN_MAP_TYPE_CONFIGS_PIN: - if (!ops->pin_config_set) { - dev_err(pctldev->dev, "missing pin_config_set op\n"); - return -EINVAL; - } ret = ops->pin_config_set(pctldev, setting->data.configs.group_or_pin, setting->data.configs.configs, @@ -174,11 +170,6 @@ int pinconf_apply_setting(const struct pinctrl_setting *setting) } break; case PIN_MAP_TYPE_CONFIGS_GROUP: - if (!ops->pin_config_group_set) { - dev_err(pctldev->dev, - "missing pin_config_group_set op\n"); - return -EINVAL; - } ret = ops->pin_config_group_set(pctldev, setting->data.configs.group_or_pin, setting->data.configs.configs,