Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp208477lqp; Sat, 8 Jun 2024 12:20:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcSb1xaVyY5qcIZo3wRn9QMB0tQcuQfyR7x1q9qAPHxHSN7ZEFLrtjRT1Pns9T83X17aJpzLk9nb3MxAEG21E5DAkd018jgykctPPmDQ== X-Google-Smtp-Source: AGHT+IEu1zUO2Vx/RzHO+la/hmhhe6tU3a07JscV82mu4L8tw6P799a4IU2oHZ+YtsDxy1TqTENr X-Received: by 2002:a05:6214:3b87:b0:6ad:7a62:5d8b with SMTP id 6a1803df08f44-6b059f65cacmr62415106d6.46.1717874401650; Sat, 08 Jun 2024 12:20:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717874401; cv=pass; d=google.com; s=arc-20160816; b=DHO/vZ8/HTRAxLun4uo+t2DR4u+qPLnk0qHkyfoXtdXuVPsMrXGq98VNAzxmWumRhI mE41Z5tuPAEMOJsm5ckZpCtj4STADIrgm6O50jWMcJSdLFTs25DFE2mk8MNsRBsRMlir k41ybPpBdPV6d32z+t1LRvCWynQyVZd3gmxt1s1OJGFy/q23jgs9PGRod+mQBAwT49p7 3bXPSN1hkXDTLTI2yYHCl/otKnKwhIwqeTfpQeVFddf7elvbrAKRc9YWTlNJp2+EHfNq 7q2Ihi3Dv4kfttIqVfT//0OHsb8+2jUm4Ws+6lhximLk7BWi0xWFYDoyEa7AS+zDJqjN tU/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=F1LeJCGHjjNHp6y4nei1kTr03Mc/C6+6qu89E1H1oJg=; fh=eOxR+HlUDW9pAnybZfJjcM2qgS8yWO9jKAm3v1++6bE=; b=GGhaPxtZxZGSnuM9m3ajmYKmudDRu+keKz9ZU+EfbhcEMznCSz5PVFjqLqKW/Jx8hD e9iH0vSam13ZY1c+7l2sARamEeygtgFGYpjHG2rlWzX3JtFf6egh71EVSFNPXOU7gy+f CA33dOO9OHeUK6yDjLQfOp5yp8W8SFAL0RZPCqdIJWr+Yh5usH3bdH01dvId3q8TYuTB IFpNuEctg38z8zPBgnuRlrhj0YbeDVYHLCsHnYlR/YYG7cXGBcBe9bBO+MZ3oA2A0WMZ ldcbiM1D+VejKspivslHCE76Hb3FyIgGcvja93Fdf9KT0zo7RYMPea1ry1Ixmz7wtyfS uHNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=M6Fh6kNj; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-207176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207176-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04f9be478si67327656d6.374.2024.06.08.12.20.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 12:20:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=M6Fh6kNj; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-207176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207176-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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 4D7E31C20D97 for ; Sat, 8 Jun 2024 19:20:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 668D4210F8; Sat, 8 Jun 2024 19:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="M6Fh6kNj" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 9E0DF208D7; Sat, 8 Jun 2024 19:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717874388; cv=none; b=Jdct7Vqi8+HKm6/VZRYPSV7H83GSKUFy9tOEGyMjUKYzwBB++iTtc+g9UCu0QaG1fa+kdIy2iMFGEphvPRi0c9TY8K14uOX6/ld2WhBXx5dCaulNdNH+V5zaGGVDElSeR//5APlvyHQ7tH8T+BtThBmbwI0CsCKEgFfM/0XIAro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717874388; c=relaxed/simple; bh=iwmtGXBeadQYz1BR7WvStUjlWi2C455oBoc3ud/Aeks=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fgJHfl7rhbBFB0TwpPbQ1SVjhtqGT4/MAhlsb4I5ke1ZevXhzvyWtjoJsfIUMP3F4SU1jzf9Ha9EcCUj3hcgvBDiFjM77heGw4ohUsTweuIoo3OHnVIl9SBbS6HvR7yp50ncmnpOEnfg+2ndmqkfaSG3Ozzgnbn7mYvAct/pmp0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=M6Fh6kNj; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1717874384; bh=iwmtGXBeadQYz1BR7WvStUjlWi2C455oBoc3ud/Aeks=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=M6Fh6kNjdEy4vCeZRbziCA9LlafxoXiWfT9DpmPUP6H2D+YcR97yUZ3hn3povp1Lb Z5oBEc7PpmHiIJ3OoWAgZZ187F0gVY8PCOZEEqenkiLNHk6Lfgyx6k+j1AgZxJ/T+e bUkA0yYOZOe2RKp3eUQvGIxwt7XYGhg4HfqoUONw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 08 Jun 2024 21:19:37 +0200 Subject: [PATCH RFC v2 1/5] power: supply: sysfs: use power_supply_property_is_writeable() 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 Message-Id: <20240608-power-supply-extensions-v2-1-2dcd35b012ad@weissschuh.net> References: <20240608-power-supply-extensions-v2-0-2dcd35b012ad@weissschuh.net> In-Reply-To: <20240608-power-supply-extensions-v2-0-2dcd35b012ad@weissschuh.net> To: Sebastian Reichel , Armin Wolf Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717874383; l=853; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=iwmtGXBeadQYz1BR7WvStUjlWi2C455oBoc3ud/Aeks=; b=Y81t2lrBOMhekgXcsMAguQilpQSiGF+UCH5p7pLG15hQ69z1vWfMlcNc06bwTgJ5x4qj2l8+0 dzz1ox36lGYAv0MdsyvCVrw2sMG3S4D26RdA5nOHutbppB/Tbzz1Djk X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Instead of open-coding the helper use it directly. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/power_supply_sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index b86e11bdc07e..3e63d165b2f7 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -379,8 +379,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj, int property = psy->desc->properties[i]; if (property == attrno) { - if (psy->desc->property_is_writeable && - psy->desc->property_is_writeable(psy, property) > 0) + if (power_supply_property_is_writeable(psy, property) > 0) mode |= S_IWUSR; return mode; -- 2.45.2