From patchwork Thu Jan 12 16:39:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 641754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A20FC63797 for ; Thu, 12 Jan 2023 16:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240871AbjALQxB (ORCPT ); Thu, 12 Jan 2023 11:53:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241498AbjALQu3 (ORCPT ); Thu, 12 Jan 2023 11:50:29 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF1856146F; Thu, 12 Jan 2023 08:39:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673541566; x=1705077566; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6PJC4CmXFBrJfU2MBAacsXz0Wb5awsrFU/gp2nAa9I4=; b=UItJK1WdACnQGbXwFOPmcWc1Un0sMWdIqXX9p+WFHx54lgevymvj/VkO hR9lFDAOahcuaBHclswY+vhIJcNX6GfsSs9Jc6ix/j4r8KaJ5GLdQc5r7 np4Gy+BbAYqkV/i9eluViFwwlgBywdjs3ZNQ83yOD/7lGhVSoANPrV9R3 3iwvq/ik97XJfk2MjFAAOfKnGF302Oey2FcQOid1MgSRdD06dNewU3jrG N3mboAU9+xEys4N8kbIgDntUGr6GuoxhJBINUhSxjku/1YeQKdVL1BKYm WxNv+Kmw+5QsDzqPCfZhP5JFq41wqlcFWYTF3ssJKBhYMwg8/IOwdqxQe Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="304132779" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="304132779" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 08:39:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="635447462" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="635447462" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 12 Jan 2023 08:39:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 67582E1; Thu, 12 Jan 2023 18:39:35 +0200 (EET) From: Andy Shevchenko To: Bartosz Golaszewski , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 1/2] gpio: wcd934x: Remove duplicate assignment of of_gpio_n_cells Date: Thu, 12 Jan 2023 18:39:19 +0200 Message-Id: <20230112163920.73102-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The of_gpio_n_cells default is 2 when ->of_xlate() callback is not defined. No need to assign it explicitly in the driver. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-wcd934x.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-wcd934x.c b/drivers/gpio/gpio-wcd934x.c index 97e6caedf1f3..817750e4e033 100644 --- a/drivers/gpio/gpio-wcd934x.c +++ b/drivers/gpio/gpio-wcd934x.c @@ -98,7 +98,6 @@ static int wcd_gpio_probe(struct platform_device *pdev) chip->base = -1; chip->ngpio = WCD934X_NPINS; chip->label = dev_name(dev); - chip->of_gpio_n_cells = 2; chip->can_sleep = false; return devm_gpiochip_add_data(dev, chip, data); From patchwork Thu Jan 12 16:38:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 641757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A34D8C54EBD for ; Thu, 12 Jan 2023 16:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240998AbjALQqp (ORCPT ); Thu, 12 Jan 2023 11:46:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241305AbjALQoo (ORCPT ); Thu, 12 Jan 2023 11:44:44 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2026DBE14; Thu, 12 Jan 2023 08:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673541513; x=1705077513; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4BOtLkvp4AVdkK2zPygGM6fUB1lerPp5K/6FblR5a3Q=; b=R5vyJ2Bagf28KdcLpfMWEKK5BjBZkusDsNjni2ghCRQUqfVKwfjpxcrs TXkCSRImEkmjOPXH5Yp9jW+F+y6U1od1pg3zAns3M7aRI8Ef3F11TmAXF aYLg5QnZvFTTrAeCqQn672iYh9ccv9tTe6+n8KaiRWlAntvdW1D8vNiwP eXVrVtYyVIBc19iZKZRSEVORw7nZ18sNdco5+2ZUr8Az8cK4haiLTVQBq 6Sn1OB+ZIh5g9ovU8p+r2z2MptqvQyVp35o2SgUOUiQt2xxPGd0sEbeAi D22IRZrUzrggCcKD9Pnn0MBjOTyEcqjOOsx6WaXaW+gzxjnXxe8g7htZx Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="304132472" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="304132472" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 08:38:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="635446946" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="635446946" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 12 Jan 2023 08:37:59 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B8AE0130; Thu, 12 Jan 2023 18:38:33 +0200 (EET) From: Andy Shevchenko To: Bartosz Golaszewski , Dmitry Torokhov , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Bartosz Golaszewski , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Andy Shevchenko Subject: [PATCH v1 2/2] gpiolib: of: Remove no more used ->of_gpio_ranges_fallback() Date: Thu, 12 Jan 2023 18:38:25 +0200 Message-Id: <20230112163825.72983-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112163825.72983-1-andriy.shevchenko@linux.intel.com> References: <20230112163825.72983-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Since the only one and last user of the ->of_gpio_ranges_fallback() gone, remove the callback completely. New platforms must use the gpio-ranges property. Signed-off-by: Andy Shevchenko Acked-by: Bartosz Golaszewski --- drivers/gpio/gpiolib-of.c | 5 ----- include/linux/gpio/driver.h | 11 ----------- 2 files changed, 16 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 72d8a3da31e3..266352b1a966 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -980,11 +980,6 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) if (!np) return 0; - if (!of_property_read_bool(np, "gpio-ranges") && - chip->of_gpio_ranges_fallback) { - return chip->of_gpio_ranges_fallback(chip, np); - } - group_names = of_find_property(np, group_names_propname, NULL); for (;; index++) { diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index ddc7a14a274f..29c283919f8a 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -522,17 +522,6 @@ struct gpio_chip { int (*of_xlate)(struct gpio_chip *gc, const struct of_phandle_args *gpiospec, u32 *flags); - /** - * @of_gpio_ranges_fallback: - * - * Optional hook for the case that no gpio-ranges property is defined - * within the device tree node "np" (usually DT before introduction - * of gpio-ranges). So this callback is helpful to provide the - * necessary backward compatibility for the pin ranges. - */ - int (*of_gpio_ranges_fallback)(struct gpio_chip *gc, - struct device_node *np); - #endif /* CONFIG_OF_GPIO */ };