From patchwork Tue Feb 20 13:39:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 20665 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp406200dyc; Tue, 20 Feb 2024 05:42:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX6xUYkwFsL4VSQmG2ZI0uj2aXi4hBM7T33VKXoIqtV8a2mXmMdozZLnd9DXMecOFIeNjJazf8aKhTqQCk7D1oR7kunxg== X-Google-Smtp-Source: AGHT+IE+k++gaPECKHcqaz8ahhH/XTPz2HDmP0Z0xZGLmtLllrRG7lORqm+cq7XdJj1eyZR0SvaL X-Received: by 2002:a05:6a21:9209:b0:19e:bc6b:e1ae with SMTP id tl9-20020a056a21920900b0019ebc6be1aemr19223361pzb.54.1708436567912; Tue, 20 Feb 2024 05:42:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708436567; cv=pass; d=google.com; s=arc-20160816; b=gcX4HJS4UaTZVmSjhK0mBMJcscgMPcdlYGbhz9e2RkyYxI90YWWyGAbP9eSDYgMpJF 1YptEcPpbQfXHo4I5OCmQLyqoZLZCyyDCQANJ5MswAlA+ka0eG8ivqZ2kjEzAxViL2MQ L9YiLhVYcW5tM64n+ktTwc3Bkk0DMNc3tNoRcUof28uthMC+goywkfLnFLPbyq+FYfHN 29muya+n1ROi/AEixPtZMcwhZvmaVRGNsQE9qHbForwI1OW0h8JZycXIqeit4/8amAcw FLeX+w6RTCRnEuToHQjAjUdFyzar8eOWnpJg9C3a9Ul4sq/Bp/T9/Hax7DH8k1Omb76Z Dh/g== 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=JR5bxG1GSyiF5ERk11qYZtMLEqsuYC3EasEln4G35iQ=; fh=QafpXXBPN+evVxhvNLO0vOTmFz/JzXhK29Onx49STnY=; b=ArPzeMLq9xxAWYHoW90ViHhJ2PgrbobLvbaUtXEcuarLEDi5jqIz1rSzwNtfS1vK8W UebJqnNx4wNAuHGOY6E2uD1Kfx26esZBXn8nUYn4YeqcI9N8oPPI77ke49Pu/ptXTHyj wCkYCbn5NILvxiVE0VKn0UMI9jlIiIT4llCf9zeQVDEDbWMCUF6FY3s5gSWpCukvB7s4 KMF2w94+I7jhQ1M84necG+/KZ+ZV2yzLnGR0PKI5n57wIgt/bfUDlf4gNrtG+S7fv4/I +ozh6rClCf3uI/dKJwaJfUfQItA250c1DfQak/HjTBpce3AJubHL3+6xvwoUfaN2i8j6 NRTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=D0wVH8Zx; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-73083-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73083-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u7-20020a655c07000000b005dc0b3095b3si6161903pgr.283.2024.02.20.05.42.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 05:42:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73083-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=D0wVH8Zx; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-73083-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73083-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 10416B2249E for ; Tue, 20 Feb 2024 13:40:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75A466A8B4; Tue, 20 Feb 2024 13:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="D0wVH8Zx" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 5DE384C60; Tue, 20 Feb 2024 13:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708436399; cv=none; b=sT6n54azLk5rQuURgA8PyR1VIW8iRE//RDEMoIAEfV55s4I/Vlsfs3zouF/2gS+kx9Ia3+3lGpBnRYvKAzjSK+SRBUhxnUb6R1YLpwjMmr4u/Falqj2uIo2nG1bxlAAe3QsZB5V4ltTKyHqlR4hlnUurIVcSAem22FJgWhjj8Yo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708436399; c=relaxed/simple; bh=maUOB1I/kGF7pxO+VAjAEbO4lZcaywIU34qr1xonNlU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=l0IMDBQv6nIZbI1FIpsSp2FQyVf80i4yQHkfMroHCz3lAmrfin4viRvoxSuiPTuJ/P7e+boJQf9r7NlNy+UUP+QQHrO0TjFh59AqIOEybXjEVEjRDiTQwvBhzwpCi99oMvrKvkBxfk6S0un534QnX0S1wHrsNbiluwmj7j2EEdM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=D0wVH8Zx; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id D42FF20004; Tue, 20 Feb 2024 13:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708436395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JR5bxG1GSyiF5ERk11qYZtMLEqsuYC3EasEln4G35iQ=; b=D0wVH8ZxwoErTe+VqwqvA29q5zZjYHP66v8cKgfbdKh70MIQBuqFMtf1xTc9Bcyf9i+wT5 vFvkzyHA8FdGvsppHWxBjlVYwDEFbOvEV/Ew3H68t4aVwwVbECf0uGX/c1RrMkGId8aL3U YNkEkee0IPomt0KwmWaPdTPign4o/Ds85GxDvmAW88LTWiWY8Ye1UJHyR2GEsJ+S034PjA +1dIqXA5f3yKos+E54FvA5r/DSe9XV3msVL2TiqAqFNfK8K3KAm9eH1bmHjZAN/3uq0b7u ZcQCZ0FPn9DermON9GYt9tW+fjnKm0G1bkoTrzUPc6w4UnNdNvyW8wWK0RuHIA== From: Herve Codina To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Lee Jones Cc: Saravana Kannan , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Luca Ceresoli , Thomas Petazzoni , Herve Codina Subject: [PATCH RESEND 0/2] leds: gpio: Add devlink between the leds-gpio device and the gpio used. Date: Tue, 20 Feb 2024 14:39:47 +0100 Message-ID: <20240220133950.138452-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791416136069786247 X-GMAIL-MSGID: 1791425582463704314 Hi, Note: Resent this series with Saravana added in Cc. When a gpio used by the leds-gpio device is removed, the leds-gpio device continues to use this gpio. Also, when the gpio is back, the leds-gpio still uses the old removed gpio. A consumer/supplier relationship is missing between the leds-gpio device (consumer) and the gpio used (supplier). This series adds an addionnal devlink between this two device. With this link when the gpio is removed, the leds-gpio device is also removed. Best regards, Hervé Codina Herve Codina (2): gpiolib: Introduce gpiod_device_add_link() leds: gpio: Add devlinks between the gpio consumed and the gpio leds device drivers/gpio/gpiolib.c | 32 ++++++++++++++++++++++++++++++++ drivers/leds/leds-gpio.c | 15 +++++++++++++++ include/linux/gpio/consumer.h | 5 +++++ 3 files changed, 52 insertions(+)