From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 590D12EAD1B; Mon, 4 May 2026 07:31:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777879890; cv=none; b=n6p7a9xMWJ+tRTO4zbrwTmjHASEg5OVVt3j4UBzf5LgEF6akFRN2QY/pb5Q8i9SX0KaWyi+uCHepW+1X9WxNodEJSZyZCLZThzzm+y6yQQZTQaAIk4BZgY/aoBShWZ8btp+TCak8B+7OStcdI8crg1ZHb8HQ1LzlceeQkLkOLWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777879890; c=relaxed/simple; bh=6g7xp08WTGLosFsZvjTI5s8npg6GBiLQJ2IOqbWCD6M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UIZe+IwvbsCmoX7yEd9mx/Nvvrq1R230JHoa5/Ce9N5gNkX/AmO1YGI5j2QHBx+yVUO4xNIRTAB6I/9AaYKfW07NPIYctBO1lY57mcjPc79iSAQG4kfWPr/xi1xgRAF4kMU8OpTVIUjRAk4/vX/8MOn9VzKbho77kRQgOKI04zg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=T2k0UDfl; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T2k0UDfl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777879888; x=1809415888; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=6g7xp08WTGLosFsZvjTI5s8npg6GBiLQJ2IOqbWCD6M=; b=T2k0UDfluzMoJr7bnVGvgrBsdSzorhFL+RGZqW1MvWRhkmTtbZq2DNEs T/NHwXvsqeF19PRjlXF70ALPFXKClTz7+RPkSmcp2dIL6KhE0gCtzPGwS VnQaB8pTkyH9JpmiUIKQUhjIW42VM4YtLITLEmHZ7v/pX0LATehdwp2Cv T12NU/o1pVpAS4/LlLQ3AyiTtdn5Gx7Z3/eARL0nRgB+nFGS1X02Ux6kq E3AXXhhQjQ9AUuF6eCnQ92lvoxvaFDw3CobROLRgH3PEK3RxZho8EC6bF 2d9oPcp4aas09ggdQrm2LRO1oZ6Vy+TlTBFZB17JCn/jLygNCwPVJp8y8 g==; X-CSE-ConnectionGUID: Fy8Ehq95SLqta0CO1+UjYg== X-CSE-MsgGUID: 8T/YpU5HRj+c7dVXy+AnBg== X-IronPort-AV: E=McAfee;i="6800,10657,11775"; a="78758081" X-IronPort-AV: E=Sophos;i="6.23,215,1770624000"; d="scan'208";a="78758081" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2026 00:31:28 -0700 X-CSE-ConnectionGUID: N0ky8Wf5Q/+58WxIh3WUQg== X-CSE-MsgGUID: TJdHNHWNQ8y+rSV7qyMi4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,215,1770624000"; d="scan'208";a="232797863" Received: from hrotuna-mobl2.ger.corp.intel.com (HELO localhost) ([10.245.245.78]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2026 00:31:25 -0700 Date: Mon, 4 May 2026 10:31:23 +0300 From: Andy Shevchenko To: Arnd Bergmann Cc: Lee Jones , Pavel Machek , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Arnd Bergmann , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH] [v2] leds: gpio: make legacy gpiolib interface optional Message-ID: References: <20260430091202.2724109-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260430091202.2724109-1-arnd@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Thu, Apr 30, 2026 at 11:11:55AM +0200, Arnd Bergmann wrote: > There are still a handful of ancient mips/armv5/sh boards that use the > gpio_led:gpio member to pass an old-style gpio number, but all modern > users have been converted to gpio descriptors. > > While the CONFIG_GPIOLIB_LEGACY option that guards devm_gpio_request_one() > and related helpers is currently turned on in all kernel builds, > the plan is to only enable it on the few platforms that actually > pass gpio numbers in any platform_data. > > Split out the legacy portion of the platform_data handling into a custom > helper function that is guarded with in #ifdef block, to allow the > the leds-gpio driver to compile cleanly when CONFIG_GPIOLIB_LEGACY > gets turned off. Once the last user is converted, this function can > be removed. ... > return gpiod; > } > > - /* > - * This is the legacy code path for platform code that > - * still uses GPIO numbers. Ultimately we would like to get > - * rid of this block completely. > - */ > + return gpiod; Do we need to repeat the upper `return gpiod;` statement? With this split I don't see that we need to have two repetitive return statements. -- With Best Regards, Andy Shevchenko