From patchwork Wed Feb 28 09:38:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 207739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3243539dyb; Wed, 28 Feb 2024 01:58:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX9eYcYuPoLcWWBnbqeHZnkerNB8/CEGe4dvge93LxJ2GN9IK84kHbwOmgfRXJnYbnGsTA9nwZmSL7Ju2KbLIdp5C5PFQ== X-Google-Smtp-Source: AGHT+IEpxZX9s+Wtyh4ZhhRkm/2Y6szaHb4DTqUVJIkGsmzyOp7+WDIc1sh35Cw8myLlv38/OO3Y X-Received: by 2002:a05:6358:468b:b0:17b:581c:430e with SMTP id w11-20020a056358468b00b0017b581c430emr15171054rwl.3.1709114311397; Wed, 28 Feb 2024 01:58:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709114311; cv=pass; d=google.com; s=arc-20160816; b=gxTG4YyWnMkQwIWbx2OdjAyPJSo8UP9d1HAwYGWt1p3Qj1UkJqUQjfz0V6qh7jaMt/ S/XH7zALqHUs8uq4awv2S1J1XjP5SsNQQUOYbjKMEjBQAUsR7gVm++6jXtBfnhCNfHz6 b3mnoAeSPUwXwU4bv6u1fiy5bPjQ/xLcwIk7aBr2Giz9epA1IK2oYYrzCtbeg+x4zi4H CUDIawvgC1Pkhj55IN8FVBmG2HnjnLwAR2IQVKIT4STpQvlRS7CpOfA8bpW6MQgAPXO6 kGrNM1e8d0E3AcfFGsLyecQC/VKgBwsssPtuauoHU7l4OmHvIYhGw5Vr+ilCmrF/NrIy Fq2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=sNxRUoh8s3Y8VjGYtxb+/b6UTZJx8qQSRBlN0iUWJNU=; fh=FOTks8ICzO5xont6vq4FlXXx5/29tzNgZetS9w4hBtU=; b=V8MLNZiMJ6qrhMigBzlloSXDRs6hsHvpOZBylNryqxR1dzcfW/0ts7F2SHIIT1QHA8 W38HCpfqP+ucf50Bb1KuxC688zJaPIeqF874pidNRkGSdXs6Z95rsAOpEXmIqZcym12J hLHUop3+9yjCJvZU1/xQThbrLpfDL3Q2gZ7m7Qj0vC/i2a2a4yVBWk6GK8xdRjcXuaTv VQEs0HnHrsTUvXYNFmIUJDClnppYax3H8LDoIPWnJbulCqzhzJcCyK2PqEEhO4l8F7SK FGYrM5pUrZbjXBszYUKiLiPzdqbI/mOXoxqz3PgbXPjgZ1OLqwgviJm/935J3nyHVh3X XBkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FrBkc9Da; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84780-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84780-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a29-20020a631a5d000000b005dc8368c570si6995628pgm.684.2024.02.28.01.58.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 01:58:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84780-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FrBkc9Da; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84780-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84780-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0CF1BB25AD5 for ; Wed, 28 Feb 2024 09:38:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B38F364A5; Wed, 28 Feb 2024 09:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FrBkc9Da" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B5D2B2E635; Wed, 28 Feb 2024 09:38:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709113120; cv=none; b=Vz1tQdrwNK26w+KnAO9vowzo7HjE+iL0MDHc6lMzEp+QGmxlEtgEvP2IcJwN7YrSYWOzlAFkVoKVRt15+xJpO7I9zJxurHlL/rzUsEALoZi9AuonZzIpd7A75EWuVeQrERqjxDyt6cPqKhAW323qCJx1bD0A2RdmXA0xXg7xl54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709113120; c=relaxed/simple; bh=s0eA/dog/BIyORieb5kXF1PEAqm7fES6Z5v+ym+lFOk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WAb+UOZPsIk+VTdsVc4gzwT4Fa5J1MWdWiFYUwDCSbQ9iCuEHkvRjPVQMpevXEBmV2MtaslQPbEPU2gTKl+UvvGw5+lpz2q3zZDuD608FqXqotvwRZ/JqjPQ3hQi91+2gK8ATFnsO11YBrP4vBnIqHwfvx7UFeijLmG+2q7ixrA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FrBkc9Da; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4D4EC433F1; Wed, 28 Feb 2024 09:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709113120; bh=s0eA/dog/BIyORieb5kXF1PEAqm7fES6Z5v+ym+lFOk=; h=From:To:Cc:Subject:Date:From; b=FrBkc9DaRryR/jXV9gywA49xnynLya6TnzHXID1+9nIUYGXeHuSBPQDgFzWrOyd0s Psu9Wt168ud26SN2nUWG7fM7gBvG7aoRiOFB3/V+m8RK2EmfczRb534/D5Yj2PX9oW 0SM/dfBWows5H5aICQinkMD59RQRaEogvh7DCvfZCbD/FqCXXxDfkWsmh640cgVRRB Dhh33KvLB1b6mYyBm0ZYe7JacrSsdt/dHIS8OfyRrUVqfWCn2Vx25r1qmh+d+zvkRP GdHwYqPrU+/aTN9n/T/dqB170/FUB6QpsHazh9Yb18AOht9LNSjU7C87ff9di7HQrA IGGsUQxG7O81g== From: Arnd Bergmann To: Pavel Machek , Lee Jones Cc: Arnd Bergmann , Andrew Lunn , Christian Marangi , "David S. Miller" , Jacek Anaszewski , Hans de Goede , Jean-Jacques Hiblot , Heiner Kallweit , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] leds: fix ifdef check for gpio_led_register_device() Date: Wed, 28 Feb 2024 10:38:26 +0100 Message-Id: <20240228093834.2230004-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792136248136315402 X-GMAIL-MSGID: 1792136248136315402 From: Arnd Bergmann gpio_led_register_device() is built whenever CONFIG_LEDS_GPIO_REGISTER is enabled, and this may be used even when CONFIG_NEW_LEDS is turned off. However, the stub declaration in the header is provided for all configs without CONFIG_NEW_LEDS, resulting in a build failure: drivers/leds/leds-gpio-register.c:24:1: error: redefinition of 'gpio_led_register_device' 24 | gpio_led_register_device(int id, const struct gpio_led_platform_data *pdata) | ^ include/linux/leds.h:646:39: note: previous definition is here Change the #ifdef check to match the definition. Note: this apparently took years of randconfig builds to hit, since a number of other drivers just 'select NEW_LEDS' anyway. Signed-off-by: Arnd Bergmann --- include/linux/leds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/leds.h b/include/linux/leds.h index 7598d472903a..db6b114bb3d9 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -639,7 +639,7 @@ struct gpio_led_platform_data { gpio_blink_set_t gpio_blink_set; }; -#ifdef CONFIG_NEW_LEDS +#ifdef CONFIG_LEDS_GPIO_REGISTER struct platform_device *gpio_led_register_device( int id, const struct gpio_led_platform_data *pdata); #else