From patchwork Mon Jan 16 12:47:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 44095 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1173147wrn; Mon, 16 Jan 2023 04:50:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXvuoIz/gmfTFN00OP4U8GdWG4Qv6pfog9lhbSQXifsX4jFZFFGUBJx0CXRkXFE5XiAiysUH X-Received: by 2002:a17:90b:1010:b0:227:1e67:d588 with SMTP id gm16-20020a17090b101000b002271e67d588mr27781984pjb.23.1673873400599; Mon, 16 Jan 2023 04:50:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673873400; cv=none; d=google.com; s=arc-20160816; b=ef7/vG6XAmjrj0+HiDHzUsK137z0n3JsIuStWvocRwy8FxcLjHAomUnNXAfM2HigjY zDV88u2wYBo5eNhX6xyzKiYL3+z0h/UWxiOJwntVSatIV/OZ3Nr3UG0TKuCUpNwxHGvj KbekN+TFEzh4aYgsEFJVLQ/D9mIz9jeWPvREkUd4hb45/Iv1zZtcDJipkwSW90pijsFX J/WUuroQiJLiT/Ki1m4KdpeINdVl/kA/+yp6AoZqrJjiiyjLpPzq/umDRaqT5Sht+8Kn /k1gzJlwdlkUplU5VcskoSS69oClK9Jh6ji/DMdYtKUYGx9MbaLv4KNoRyvp3vWJ56rV 4jxw== 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=rto9b0vQNSHBrraSVBZSvdoSsKo4LDpE2DYddgDcbZ8=; b=nqJF68z+cXdPXvUObKnwEwOTWmwTUM/V+n5tEIgPFm+6cugAo71NI4jQAsljXYfTCP 1k5Ft43SSrOU/txrU87ErMirwQOBP+yFCxKhAbmmd6L0R9SWK/ulB9l2YjgbaIxImODV blo8etzJiLVtlCWsbBXaZAoQk7yDSLRFMuWFarxa5Y8Wd78R1xQr1PQ4LwJ1G08ykeon W5fFhTqGFFfBm/d3swqOfOfLUHeuWs9RiXQI2aS7B7aBF7D0lTLFEG4MN1MvqS6UJ3tQ CuJWkeQYZ7rDqhf7vF8+GbUGg0NAKbbfNdxQyDXun1lY1cSkuYZ3X4/nZR5rkiR2ozOW JpWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L6rZGFZM; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pq8-20020a17090b3d8800b00226caf0b401si27675397pjb.3.2023.01.16.04.49.48; Mon, 16 Jan 2023 04:50:00 -0800 (PST) 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=@intel.com header.s=Intel header.b=L6rZGFZM; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbjAPMqp (ORCPT + 99 others); Mon, 16 Jan 2023 07:46:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230395AbjAPMqg (ORCPT ); Mon, 16 Jan 2023 07:46:36 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 717138698; Mon, 16 Jan 2023 04:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673873195; x=1705409195; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cV2t2J41BPlMwIKrRYG/9Xa0hABR7bL6sMDaCR/ixl0=; b=L6rZGFZMWqLZpbJoBX59s1VCVfW55CjZNh/5zHu091TKy2JRRJR1vpyn AKpGOwnZJ3I7nLkh6UCi9ueZ5HbD7j8R5y+Ay9npUxDlRjQ4Jp3VKezBT jz9vizkqHxlvqtuUOZ4qnIZgRfZZyHV6F7UVIn2C1X/H1FttaGdPt2St9 88IwJ+wP8+NgmKfxkSGuNXhtXxDZvMDqBwezv8R0OoAYBNam5EH34N8HK 6zrO8TtsG6eiaiMf47FmA2Lx29wBe31Cn8qN5da/2RBBHm+ZZu9Hg0lBQ 6SLzOQ+WjU2Runjh/GsiLIwrGRZJ9juHy3cgSHJLmUih2g+AbHGKdhVtb Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="308009850" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="308009850" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 04:46:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="782895856" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="782895856" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 16 Jan 2023 04:46:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id AC4061A3; Mon, 16 Jan 2023 14:47:06 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 1/3] gpio: pcf857x: Get rid of legacy platform data Date: Mon, 16 Jan 2023 14:47:02 +0200 Message-Id: <20230116124704.30470-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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?1755183474734318659?= X-GMAIL-MSGID: =?utf-8?q?1755183474734318659?= Platform data is a legacy interface to supply device properties to the driver. In this case we don't have in-kernel users for it. Moreover it uses plain GPIO numbers which is no-no for a new code. Just remove it for good. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-pcf857x.c | 34 ++------------------ include/linux/platform_data/pcf857x.h | 45 --------------------------- 2 files changed, 2 insertions(+), 77 deletions(-) delete mode 100644 include/linux/platform_data/pcf857x.h diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c index d9db878802b7..dfa15444a24a 100644 --- a/drivers/gpio/gpio-pcf857x.c +++ b/drivers/gpio/gpio-pcf857x.c @@ -7,7 +7,6 @@ #include #include -#include #include #include #include @@ -18,7 +17,6 @@ #include #include - static const struct i2c_device_id pcf857x_id[] = { { "pcf8574", 8 }, { "pcf8574a", 8 }, @@ -277,18 +275,12 @@ static const struct irq_chip pcf857x_irq_chip = { static int pcf857x_probe(struct i2c_client *client) { const struct i2c_device_id *id = i2c_client_get_device_id(client); - struct pcf857x_platform_data *pdata = dev_get_platdata(&client->dev); struct device_node *np = client->dev.of_node; struct pcf857x *gpio; unsigned int n_latch = 0; int status; - if (IS_ENABLED(CONFIG_OF) && np) - of_property_read_u32(np, "lines-initial-states", &n_latch); - else if (pdata) - n_latch = pdata->n_latch; - else - dev_dbg(&client->dev, "no platform data\n"); + of_property_read_u32(np, "lines-initial-states", &n_latch); /* Allocate, initialize, and register this gpio_chip. */ gpio = devm_kzalloc(&client->dev, sizeof(*gpio), GFP_KERNEL); @@ -297,7 +289,7 @@ static int pcf857x_probe(struct i2c_client *client) mutex_init(&gpio->lock); - gpio->chip.base = pdata ? pdata->gpio_base : -1; + gpio->chip.base = -1; gpio->chip.can_sleep = true; gpio->chip.parent = &client->dev; gpio->chip.owner = THIS_MODULE; @@ -406,17 +398,6 @@ static int pcf857x_probe(struct i2c_client *client) if (status < 0) goto fail; - /* Let platform code set up the GPIOs and their users. - * Now is the first time anyone could use them. - */ - if (pdata && pdata->setup) { - status = pdata->setup(client, - gpio->chip.base, gpio->chip.ngpio, - pdata->context); - if (status < 0) - dev_warn(&client->dev, "setup --> %d\n", status); - } - dev_info(&client->dev, "probed\n"); return 0; @@ -428,16 +409,6 @@ static int pcf857x_probe(struct i2c_client *client) return status; } -static void pcf857x_remove(struct i2c_client *client) -{ - struct pcf857x_platform_data *pdata = dev_get_platdata(&client->dev); - struct pcf857x *gpio = i2c_get_clientdata(client); - - if (pdata && pdata->teardown) - pdata->teardown(client, gpio->chip.base, gpio->chip.ngpio, - pdata->context); -} - static void pcf857x_shutdown(struct i2c_client *client) { struct pcf857x *gpio = i2c_get_clientdata(client); @@ -452,7 +423,6 @@ static struct i2c_driver pcf857x_driver = { .of_match_table = of_match_ptr(pcf857x_of_table), }, .probe_new = pcf857x_probe, - .remove = pcf857x_remove, .shutdown = pcf857x_shutdown, .id_table = pcf857x_id, }; diff --git a/include/linux/platform_data/pcf857x.h b/include/linux/platform_data/pcf857x.h deleted file mode 100644 index 01d0a3ea3aef..000000000000 --- a/include/linux/platform_data/pcf857x.h +++ /dev/null @@ -1,45 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __LINUX_PCF857X_H -#define __LINUX_PCF857X_H - -/** - * struct pcf857x_platform_data - data to set up pcf857x driver - * @gpio_base: number of the chip's first GPIO - * @n_latch: optional bit-inverse of initial register value; if - * you leave this initialized to zero the driver will act - * like the chip was just reset - * @setup: optional callback issued once the GPIOs are valid - * @teardown: optional callback issued before the GPIOs are invalidated - * @context: optional parameter passed to setup() and teardown() - * - * In addition to the I2C_BOARD_INFO() state appropriate to each chip, - * the i2c_board_info used with the pcf875x driver must provide its - * platform_data (pointer to one of these structures) with at least - * the gpio_base value initialized. - * - * The @setup callback may be used with the kind of board-specific glue - * which hands the (now-valid) GPIOs to other drivers, or which puts - * devices in their initial states using these GPIOs. - * - * These GPIO chips are only "quasi-bidirectional"; read the chip specs - * to understand the behavior. They don't have separate registers to - * record which pins are used for input or output, record which output - * values are driven, or provide access to input values. That must be - * inferred by reading the chip's value and knowing the last value written - * to it. If you leave n_latch initialized to zero, that last written - * value is presumed to be all ones (as if the chip were just reset). - */ -struct pcf857x_platform_data { - unsigned gpio_base; - unsigned n_latch; - - int (*setup)(struct i2c_client *client, - int gpio, unsigned ngpio, - void *context); - void (*teardown)(struct i2c_client *client, - int gpio, unsigned ngpio, - void *context); - void *context; -}; - -#endif /* __LINUX_PCF857X_H */ From patchwork Mon Jan 16 12:47:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 44094 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1173092wrn; Mon, 16 Jan 2023 04:49:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXu7xfJoZaSeBWjOAvsqH/zreLdSSFK1MzfU3xujzbw4TipKjesyHRwLpqFlBzjDgzlolSFc X-Received: by 2002:a17:902:a40b:b0:193:234:443a with SMTP id p11-20020a170902a40b00b001930234443amr37515759plq.45.1673873388011; Mon, 16 Jan 2023 04:49:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673873387; cv=none; d=google.com; s=arc-20160816; b=l9sRYtyMGAuO1l76vOqw7seiwLWi0aGMeYOFj6E1wW65hhsHl9q9qH49T9Egug6I2z T63TVvy1PESLAzD2oCmpqXCnkwD8NpgIdUVHVhzNVrgJJEi6eoTGbVbMq8PGHufOOasZ D3qyhUpBQutBdUjM20TYdDlGK8nhTb3Q8FY0AdXTVW+Qhg+475nuHMKgtEcO3APs9sek /rh4bppw942pOX06ttHMFYXdnx3q+HelUMuP5M5SVjL/+RfqWfsD/hrmNKhnmPYVrQDD dRfBRZVVfoAJ3rC30re84Kcy15MKg7M459U4ywiO78TLHnUbFuuKA0aYXYEyuHCFI1B/ DFQg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RK12eFyQZk0WtWviFwOe+snb3eD2xXYG7r3m8MbVBnc=; b=otTU5qn0wqqssXAUymRRtAXZYvm9qXuCMaFp7jMWqybi0V9otLhCR9EJyLeJB/hLS5 fi3DAO6Pm7gwtHZgiSZZOVB0di0oClFQCtMyOPkQZ33hGfGqjdt3vGY+GcIr80e7kYD6 h6CbgiZ9LVmCGH/kxYVtmEyGD6RSTyuQnBra68vOeYBD+2Er4IDXRa+Pd8/feVEkmrLY lqWoniFo6rhGJfHeYCC2YKW4WzFezrFrzYUPtC98XoG7h77yZmqIog77qmDaJswP4Asd bWEe0828ngRYSTznow7onuNmuYwL6F5qWIVBF4ihtsUToLKzn/hYK9iPl0xMVNd1njYA iVWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TJZTGM3W; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a170902e84700b00192a5275dc6si13394968plg.585.2023.01.16.04.49.35; Mon, 16 Jan 2023 04:49:47 -0800 (PST) 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=@intel.com header.s=Intel header.b=TJZTGM3W; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbjAPMqg (ORCPT + 99 others); Mon, 16 Jan 2023 07:46:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbjAPMqf (ORCPT ); Mon, 16 Jan 2023 07:46:35 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 565713A9D; Mon, 16 Jan 2023 04:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673873194; x=1705409194; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BwXZVfB+xF4aartu15hkES7lfjOUi/vmIT0fRE7IbyM=; b=TJZTGM3Wrv7m1D6vLl7IVK1nIjHSaOvX6Xifqm99PpiM16bdf6WC0kiT YSf9r/zSuXJI11xM0aoURxto1QUTcvllgQn267XoEVB+2wNM2iSkStEYa k8nd1pBjaNJmK5WiGoTEtZF6snJmfswCGclBLfhY199n6BK+oBMatRYqt MPoP3QNvFqFbaSXrbdSsfO9OWhD7S5Q3zr7vqVeNWBVX36N/uOyLtonYy /JXYW2BE2OVdz5ajR4+dPvtUIGkldizA2dlQ4fZ4VSDzVu15ZyNK17d1R rMXDr3NPeMgYUnf3NCpikgm/tWiYrmLVrUs5IGmQgaK4jvLDWmF0xkFIR A==; X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="312306377" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="312306377" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 04:46:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="987791362" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="987791362" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 16 Jan 2023 04:46:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BBCF914B; Mon, 16 Jan 2023 14:47:06 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 2/3] gpio: pcf857x: Make use of device properties Date: Mon, 16 Jan 2023 14:47:03 +0200 Message-Id: <20230116124704.30470-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116124704.30470-1-andriy.shevchenko@linux.intel.com> References: <20230116124704.30470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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?1755183461701886955?= X-GMAIL-MSGID: =?utf-8?q?1755183461701886955?= Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Add mod_devicetable.h include. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-pcf857x.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c index dfa15444a24a..9d34776109db 100644 --- a/drivers/gpio/gpio-pcf857x.c +++ b/drivers/gpio/gpio-pcf857x.c @@ -11,9 +11,9 @@ #include #include #include +#include #include -#include -#include +#include #include #include @@ -35,7 +35,6 @@ static const struct i2c_device_id pcf857x_id[] = { }; MODULE_DEVICE_TABLE(i2c, pcf857x_id); -#ifdef CONFIG_OF static const struct of_device_id pcf857x_of_table[] = { { .compatible = "nxp,pcf8574" }, { .compatible = "nxp,pcf8574a" }, @@ -53,7 +52,6 @@ static const struct of_device_id pcf857x_of_table[] = { { } }; MODULE_DEVICE_TABLE(of, pcf857x_of_table); -#endif /* * The pcf857x, pca857x, and pca967x chips only expose one read and one @@ -275,12 +273,11 @@ static const struct irq_chip pcf857x_irq_chip = { static int pcf857x_probe(struct i2c_client *client) { const struct i2c_device_id *id = i2c_client_get_device_id(client); - struct device_node *np = client->dev.of_node; struct pcf857x *gpio; unsigned int n_latch = 0; int status; - of_property_read_u32(np, "lines-initial-states", &n_latch); + device_property_read_u32(&client->dev, "lines-initial-states", &n_latch); /* Allocate, initialize, and register this gpio_chip. */ gpio = devm_kzalloc(&client->dev, sizeof(*gpio), GFP_KERNEL); @@ -420,7 +417,7 @@ static void pcf857x_shutdown(struct i2c_client *client) static struct i2c_driver pcf857x_driver = { .driver = { .name = "pcf857x", - .of_match_table = of_match_ptr(pcf857x_of_table), + .of_match_table = pcf857x_of_table, }, .probe_new = pcf857x_probe, .shutdown = pcf857x_shutdown, From patchwork Mon Jan 16 12:47:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 44096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1173211wrn; Mon, 16 Jan 2023 04:50:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXtQftaLcD7EHOAaRZB+75UbrdYw4EwJXrDeMP4quNM2H7c5kMuBFnjPMKu1MjsCqU8h0UKo X-Received: by 2002:a17:906:99d3:b0:870:23c5:8a81 with SMTP id s19-20020a17090699d300b0087023c58a81mr4614744ejn.41.1673873410542; Mon, 16 Jan 2023 04:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673873410; cv=none; d=google.com; s=arc-20160816; b=h9GGgaHpdC8e2y/+e65dGhTxgthCqsmR1YPugIkUoPwg/uNqkZhaTdwcHYiMslj8BL /GcdPLjzmqG/EMb9VrUMRW69jhA1KoQ3UQ79yKas7CCrMf7mxpvkgkaWV9MAzreiyhrc Nyw4IaXcmyATEgVS82F9GYDtVL53FvYNHbmASMrN8OKAuhmh5zoUNhVXmRBymBr5E+2G P79PEDhwLO/MyNZtmWk0B0WUhm75cwx5Tz+Z+ce65NUev6YbFHimRPQFcWFUQjvjA+Lz v7f4P7VE8XSwBvyZ1tpj4yo2vBaITH9+HZ0UunTfYeixgtW0Eb+x9HurQCvI9t70rFv8 7BWA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5RMMFlXXTEiRspbrPt2xQdJfOzbea8ffcEXTNlzrQeg=; b=h7aU+OEZmjulfHAkpFnm7Q7AfeKNtAcmQLtKw1RmhjiB9juYVUTJZHulSCEugYKPHP s6uBw08F+aZAqMMas/Z8tr7q1o54nBvzC+bJv/4TyAil/CweBI8VF/flC8BWXIeK2wC/ pbA1AZuApX/RpSlTmM74gOJvd/C3+UGbmq1vKwz9c0/nBjim9dR3FQ79o/7t++Z0fRAR QvXK+GNVoa3w6vmIaZXfJONfcXJnwgNYC3c2BJfTNdnFoL+0XxhJe3yXzAzNK4cbyyMS BeU+trxKf0rbAo+F/YDe4pBuyz5NlyVqc2msaGG+vqoWKbu0F/ezyKhF3Fq0r8Fmwn5+ ljTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kjggTLp8; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o22-20020a170906975600b00780a240cfd7si22436408ejy.493.2023.01.16.04.49.46; Mon, 16 Jan 2023 04:50:10 -0800 (PST) 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=@intel.com header.s=Intel header.b=kjggTLp8; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbjAPMqk (ORCPT + 99 others); Mon, 16 Jan 2023 07:46:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbjAPMqf (ORCPT ); Mon, 16 Jan 2023 07:46:35 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBDDF8686; Mon, 16 Jan 2023 04:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673873194; x=1705409194; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Xp2JwHzpxBrb4N5/U9Ns3KD8bpJ3bcjuxAofJ9rLRq4=; b=kjggTLp8NDMRHYOitcDGtfNmR3E/KKdZVvKQno8oMhNMGYSR3Tl2vJSG hSGOWGfUnTeIJgqWuvPsp5hPIAOZBkLtTR9QbU1qZF/pcpMuWI3vksV9Z YbFDY6a7byX369S7WBmuTKIRa92TS4mEKy9gt3+9x9xX51jTpEUTLx/mE oA7wqpBA3BdtaBb5GUqptc4z2m06k2yxJJBLG8UkvjAWcILvLq3fvMOe6 ybVCQZtbfZZZQNThV2BmT7bi1FECfVWSy2OvFmtCyr+FWeXalUeMTX9P4 HNSPRdinkydV4YxjQNg0X/8eurn3XoEOupRcK67i9JjhPplkKBRYlJOQ/ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="308009855" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="308009855" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 04:46:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="782895859" X-IronPort-AV: E=Sophos;i="5.97,221,1669104000"; d="scan'208";a="782895859" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 16 Jan 2023 04:46:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id C9BCC31D; Mon, 16 Jan 2023 14:47:06 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Andy Shevchenko , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 3/3] gpio: pcf857x: Drop unneeded explicit casting Date: Mon, 16 Jan 2023 14:47:04 +0200 Message-Id: <20230116124704.30470-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116124704.30470-1-andriy.shevchenko@linux.intel.com> References: <20230116124704.30470-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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?1755183485099063225?= X-GMAIL-MSGID: =?utf-8?q?1755183485099063225?= The s32 is compatible with int, no need to cast. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-pcf857x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c index 9d34776109db..3de1d3ad7472 100644 --- a/drivers/gpio/gpio-pcf857x.c +++ b/drivers/gpio/gpio-pcf857x.c @@ -88,7 +88,7 @@ static int i2c_write_le8(struct i2c_client *client, unsigned int data) static int i2c_read_le8(struct i2c_client *client) { - return (int)i2c_smbus_read_byte(client); + return i2c_smbus_read_byte(client); } /* Talk to 16-bit I/O expander */