Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1660193rdb; Tue, 20 Feb 2024 03:12:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUhe85s2KouWxCQlxd6cP0N/fb+MCPs/A+UAe+D1zL9jWKIFuQLzyXUwvZhxyIUe7BRWkqep4ahrYBcQ9fBbed96KEE3f1AfANaBiA0bw== X-Google-Smtp-Source: AGHT+IEfIqOElsCkyRnVq7/oj0jG9Z/BTOPrMbxYyVBi+sC6Kn9I4Dq8aNYXjAIKpl20Pd9ZyDK6 X-Received: by 2002:ac8:5f11:0:b0:42d:c7e2:f1cc with SMTP id x17-20020ac85f11000000b0042dc7e2f1ccmr18216271qta.64.1708427569495; Tue, 20 Feb 2024 03:12:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708427569; cv=pass; d=google.com; s=arc-20160816; b=e0CbPiXyqkqeaJcZTbrows7TGIXeY19Nkq0OowuGiAcGsoaYTTrIrYU/JqjZNeE7Ns vzGh8BYn1zGt3tBM/ZRbU+oyTVaHKG0LCq5+HgicH1BEMYOcxoF9TEQoqfOPfYyDOtws 7tmkeMVq+gn4HN29OJ+lLWRNQZR4k90AuNRoEBBf3d37cjQVYLxrP/+Yq3ZcUerCoKKW +Ys8m72thmGKIwHBhZlPYell3wXyLGT4yFgV9hiFcXh7HI8CZIVZD1YFUgt7nqnV3cIw dn59aXdUWnGr2rCrJC7ByDCMCZpQADQl3PTmwWECL00v4NQOc+3WGeR0HsxZab8ZQH4W WlJg== 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=xmFK5hcLCBfL8sT1NgJSxwVo8Y8dt6xsqwCFD5JhFCo=; fh=TIjbBxd/l6+S4b7dg68RvZRBjqJDDF/pxzDVsIxo55U=; b=DG6w/OWHVSLnRXXvowkDPc2M0Tpjfp0l36TE0YLeNMjfmNtDQtB3veu0gH02MoIck1 LennXP5M9d/G1R9ctTwomBmrKvmLShDxbVQfQqcC/u4PRpwfBzHIhNlrzS7VUsY3USXy CSvy/fFcefjmkvgPlyIc0n7XqnnyutAQEVvLnUvt7+oxExCpmH1wIMa4KtUQOKvYJ5JO 8UrEvncvU5OqsqhdhzfvxyrQhmHh++c3sso484odIL1O3JRy4T6EjhAnKK+tb5ySn1tg 5pZj6jxFPF7Dqi+0O8dW/SixMA9daKPHVvs0FZYmBrdfiYCbvrC56rmLIs+HILl8X0ew CIqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Qti7E+bl; 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-72882-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72882-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e21-20020ac845d5000000b00429d470ea36si7614863qto.592.2024.02.20.03.12.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 03:12:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72882-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Qti7E+bl; 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-72882-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72882-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C2F151C23734 for ; Tue, 20 Feb 2024 11:12:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0E3066B5B; Tue, 20 Feb 2024 11:11:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Qti7E+bl" 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 C892566B53; Tue, 20 Feb 2024 11:11:22 +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=1708427484; cv=none; b=C04STNs4UNP+qoWVIS4AhLYj8IzklDHn80w76fYNFoBGIQ4UFQMEDLAsiPJ3jcKgPtRA8OZjmuJKKqqLw8206eXtj+q23OOpRs34GkoaaB/nmE4qbmJesUQJcfpgEGfynx25xte2ly7OLjajQj8+AL5GMUZAPwinaJ30WPbV4tU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708427484; c=relaxed/simple; bh=XVDZEqs1XKALnlDFBu5ExtsMe/5zs/aTyLiZY4pOOVY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=f93/5ZjpAjVzUU3v6FmUD/ZXexpv0F8cXwbXt7W2pWIpwX57sYxRhiQzHsvPfPZY8AoS4XhQhlf8MdsqagKscwZ8O6O1aLaLwJfVYiC536/4VBEJQfWZB26KCi/PKaEjUCBaIhrVSYOqhfY9UImR8EGVZP0ldz3agzyQeWcIEjY= 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=Qti7E+bl; 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 A8AA62000C; Tue, 20 Feb 2024 11:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708427480; 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=xmFK5hcLCBfL8sT1NgJSxwVo8Y8dt6xsqwCFD5JhFCo=; b=Qti7E+blmV8mhMSo/RM3F52rfMrHLNSV34HhQ2gl4OFsTv43YEyxakXq1CeIOPzfpVW/I6 L9TQr160H+Z+biQrF/rUpEY9b5V06RYhMtmnTy5tMFcp/kH5rxFLrKIACjecVq54JJ7YRz PAggqpcTeyIkVL6HM1tGLqjWHePPw7YjlU0bJOs/kLBbdegVu7naBEinskJjlBS5cwsQt5 rAX2YSA6L25CeD8oW+wZVwoMZCCA+XCIUxDFCc58PlV1sra8lx0s1F4ZxPCdeSLou5Kawj iSc8G8M+1b5PGT6FWZ7WrAqofU+6WQMG/P041veBhJ9a/MnzPmLTxR8ZJMPaTg== From: Herve Codina To: Linus Walleij , Bartosz Golaszewski , Pavel Machek , Lee Jones Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Luca Ceresoli , Thomas Petazzoni , Herve Codina Subject: [PATCH 0/2] leds: gpio: Add devlink between the leds-gpio device and the gpio used. Date: Tue, 20 Feb 2024 12:11:05 +0100 Message-ID: <20240220111111.133826-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Hi, 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(+) -- 2.43.0