Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp9436lqh; Thu, 30 May 2024 12:14:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEe4Om2m0o6l0RIcDylisDujv0UuTMPpUQgboGFUVJQOiqBTSvLbxx5zk18I9rP2psVrmoOHBWoXgWFHvEp2eZv9sXaV5WY7I0OWXpDA== X-Google-Smtp-Source: AGHT+IGBYduHVHk65mRtDpWC0ySvrdByNhSxvdpyXxSlkn2J1MTj3XQ6y/e3qQAU8sQBWzDwZWSQ X-Received: by 2002:a17:90a:c914:b0:2c1:b66c:d414 with SMTP id 98e67ed59e1d1-2c1b66cd54dmr2021035a91.36.1717096469801; Thu, 30 May 2024 12:14:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717096469; cv=pass; d=google.com; s=arc-20160816; b=Z+KKcJLrprtaQrKsR5OdbR+xMOb9fwlvVJGR2WN0QxecFqIhhK7xEY8GmLMI3wd5tv QVit51hCK9gWGJ7FN9QIuSX2adcyuyqXVZyMfUZkoFnl3ms+aB3bMViLEX23ZUOJTDb/ 64F8jR0RI0MOEIeDOpaVEIcazu3ZzcC0k3R9LxrtKKlUw5dUmPfO8ehOorz0StGFZ73w kSMxwA2xEqF+sF4lSl8/cuz+V45MGY5FPaJ+giI39ZaNO3hA/2EDxAy/mnoh44mvtJG4 NooAqI+O/hSkkMe7oRQ299rZG9JkW8FZbHkuzfnlI1i6+d3lg6QrIHK3+dHOY4+7X0ye dY2Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mJTPJ62EEp+vzwW12jZLZkscL/X5uA0Jyn0sDQ/P+Ko=; fh=SVFF+esd2teALkQTF73glKuoQ8orDUlWFxgw6NzwcXw=; b=qa+xI94lNWjWY4WlLqlmRLnYTv+kaVooy3zAKk22iyOx+PIJB4nHkuZLJZIDFXlrgm oJ5jM6b3qCTg7kaNKhIdmXQQ32xyuiJZSHLs5Yd5C65b/nEPkv3nK5qi7mw42Iqwx1iu ZH9QuEPUaEy8BISXKJ9NtNmF6c1Ip3MwJ+/CsvR8FA/0IpUavWBCPo6WYKS7G64L/jh8 r8u3WD/N63VykIKc9luFhJOmYymjuXdVzOASOlH1uUvmnyrVLLLlWe3y9XMWGqnAAHVA vfLu5AbT5bCS/jVDyoEcruZPTNAsQcv3nUXknI/Jybj1yMcjN8Fjm27AUKyvrokY2WaJ C2BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BWxelvR3; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-195812-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1c282aa7bsi178904a91.101.2024.05.30.12.14.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 12:14:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195812-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BWxelvR3; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-195812-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 327F7283C12 for ; Thu, 30 May 2024 19:14:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4171D7603A; Thu, 30 May 2024 19:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BWxelvR3" 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 159EB75811; Thu, 30 May 2024 19:14:22 +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=1717096464; cv=none; b=A0CAatUUPyq4dW0S1Sb6f7jmE4Kq79cnI+EFzZjgcJtpSXCwVAJdajMLW1pGXYijqHFy2M6ThPvqhvGNoWKzhQutrNx/70nxE0/j4+Yp/w8eeAxJ1epYZ77vba6AFfz/VW2frqAIZKQcE53g1GoqWxePxfO8NyAer7fuYG1dU4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717096464; c=relaxed/simple; bh=OwLMnjpc9AQDv1GcWWb8PG176sszd4a1hNLH+QokR8M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rAmV+ZR0I1xCnLyk4jXbcEtqcccyBH9VSacJXxEbhgYv4K4NglW70R4byy6KAbclu6/jj6OUcd8hzrgGQbZDiijattsgP16xvqGrKCttpV37EVFxY46ZHgobHa5vyyfRjKwAK61quyGgaUTRCX30biWpOCeefvllgNB90iA6ZC0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BWxelvR3; 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=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717096464; x=1748632464; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OwLMnjpc9AQDv1GcWWb8PG176sszd4a1hNLH+QokR8M=; b=BWxelvR3LnX+msamBzc8EQx3mGIpkNi4507rJ8nq1UUL8PMH7sOHex19 lTcfoaiNFWmCUNvVQ8gXJ+CjS+ZLFME1V9FmoUUrYiaWNW4/9IdZOvh3k 5ppKXLUx2ucGCEef3NQ//u5i4za4Ipsg/KmTW8I+4hCN3sQOFu12mcA8s Fv/gkYa9hbvuyJe1xDDs6HkT0KIxLphCXxm/OO4oKLQiuXgoWthlse/g0 aq8oJ1qiZdIlYiksMFNyQrw+iTWjEP5MHxt3Cqhh0RGCt/Ba75UxV+fFp lARhZPaPdGloQ7tY0aIdSVCx/8JLxhunLQ5UKseZaXhnkaF7l/OB0sr5u g==; X-CSE-ConnectionGUID: Vq+qyU5lQWa3sMcs6qsKlg== X-CSE-MsgGUID: m6bOQ8t4RoatO8oLdhdyLw== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="13779055" X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; d="scan'208";a="13779055" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 12:14:23 -0700 X-CSE-ConnectionGUID: pVOnVVNTSKKiJaqgoy3boQ== X-CSE-MsgGUID: PkD6iQuGTguIOUlItnNc8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; d="scan'208";a="40978618" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 30 May 2024 12:14:21 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A7A2B184; Thu, 30 May 2024 22:14:19 +0300 (EEST) From: Andy Shevchenko To: Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko Subject: [PATCH v2 1/2] gpiolib: Return label, if set, for IRQ only line Date: Thu, 30 May 2024 22:12:29 +0300 Message-ID: <20240530191418.1138003-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240530191418.1138003-1-andriy.shevchenko@linux.intel.com> References: <20240530191418.1138003-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If line has been locked as IRQ without requesting, still check its label and return it, if not NULL. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpiolib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 73c9f99d141e..a6032b84ba98 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -107,16 +107,16 @@ const char *gpiod_get_label(struct gpio_desc *desc) unsigned long flags; flags = READ_ONCE(desc->flags); - if (test_bit(FLAG_USED_AS_IRQ, &flags) && - !test_bit(FLAG_REQUESTED, &flags)) - return "interrupt"; - - if (!test_bit(FLAG_REQUESTED, &flags)) - return NULL; label = srcu_dereference_check(desc->label, &desc->gdev->desc_srcu, srcu_read_lock_held(&desc->gdev->desc_srcu)); + if (test_bit(FLAG_USED_AS_IRQ, &flags)) + return label->str ?: "interrupt"; + + if (!test_bit(FLAG_REQUESTED, &flags)) + return NULL; + return label->str; } -- 2.43.0.rc1.1336.g36b5255a03ac