Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1985534rdb; Sun, 4 Feb 2024 09:28:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IHU/IhADCIMZ8dF6JnOQKGTgzypvKn+H19UbYjU+UUys7FIBz5VmrB1VeMH62gHfDP0Z4Br X-Received: by 2002:a0c:e4ce:0:b0:68c:45b8:4efd with SMTP id g14-20020a0ce4ce000000b0068c45b84efdmr4450123qvm.6.1707067706289; Sun, 04 Feb 2024 09:28:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707067706; cv=pass; d=google.com; s=arc-20160816; b=Z/9YWb+1iMuKswxW75y7jKrqB/mUrFuVxc/a3qQZ0szNuKas6b0xDrdZoNms7hEN5y TxmNS8YGD4GnSY+VSdXHM1mzQImO3WEAjSM3bUTM/zJKobDUVodWX1WRtiXXsR+5o6M8 1pWZiJQK3lM2gMTSLQh4rLofj54NpGbRFvt5VuV+mD4OT91Mt/uP9GfzPXrgQkwHLKtd VHJtsLElOBDKkrxszODTD/ucpNMd+X/jaNmlUv2OWxah8+hIoz/zrSjrmAUtuTWHh3GB sXpb+4fr+ah8URR89xdR3TspkFvyZ9EIniqG/AP9BDr52xUMOha8j6LNaoF2LzUNCwjE 5ZtA== 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=Vj3N3Ev3DWQHZSNvEeoLP2V+sUiN/C/yOA3ASkDQt3U=; fh=w6mlw+N7w2lg8MxDGcrbPp/Y7A2/MKBL6pOZOL3DBto=; b=pf2U1pnSxRjt/fbiGcmbEsc10ACgCgkeCHIQoGrMYEqmLxXl5si5IcYQFaRxanJPbA enXphRjja7s/Dz/8WBroV6XfLDJLE+EfRX3dfOXPeRIskNDO04W7A/m43XnoOiUu3i1c Y8n6Wne/pxNBS5qvuXsGL+948CQmeaejrpLaJbo3g16B2gLpQUeaGbQL/Q6tGocoedcp 1Gpb5P8PMu9FSGMp76jhDAIOp2s55Y3M7ePSvakyyPHNlQTREU/h51av67UrGJtwZEIO bFjfm65Q5Rs6pZvrzxRtXQ1fjCbn1QrHlsWgwr5VCCcOOK6yzcQGnv9dXnJvXgztZVno 42lA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=gEt+CYFa; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-51823-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51823-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUCFeLnoyheF5HkU4V83LTn8l5CnA/FF6mDhMY2hiapAP4C1LHun8Oza4ZyRxGEACjziyBsPOg2k8uSfui/QKzXA/bc7r4GC5uw6BID9Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c9-20020a0cfb09000000b0068c3a96d43dsi6521433qvp.218.2024.02.04.09.28.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 09:28:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51823-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=@weissschuh.net header.s=mail header.b=gEt+CYFa; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-51823-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51823-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0EA611C21960 for ; Sun, 4 Feb 2024 17:28:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DBF22562C; Sun, 4 Feb 2024 17:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="gEt+CYFa" 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 B574F249ED; Sun, 4 Feb 2024 17:27:05 +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=1707067629; cv=none; b=dHH63r4aIK3w7nNfv8aty8iAdAjPaFLFBkh20/TRfn8BFHG9QFp4Hqznez4ugsItgGgJdv0TaHlEq+QEXWq9p2DbymZgdERne6OoyC9fDrtoqsgWJ0fxfWNObStAcrekhqCN+CtGB12GwNSe4m/rWSFjYyCyhenw0dXDKbmsNoI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707067629; c=relaxed/simple; bh=IxAmxaUd639konem1J0CwPySbGfu/rKfRx4PF1P1Nfs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=prDWyAgKBHPm+bEi/8724guZTUeGfeD5aJnYz3zLikrCigHTb60u8f4UXjPuMuaeqwsvotLaKLlzbn/oldfFqBg6tnpr/uDBvAeISHP1nt2ynyzz2f0S/S2rMxBxs8LgbJw1ugVv/ZZ6Wt6HrBD6w6WUufvSwNrDQVooZ24usmI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none 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=gEt+CYFa; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none 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=1707067616; bh=IxAmxaUd639konem1J0CwPySbGfu/rKfRx4PF1P1Nfs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gEt+CYFah1lDU279fX90PzcJZtwNiZTHhOkKgmMS+iwsL9kJdmFX+fW8UbUqEfDww +ba8M3dextPoKKVkjZUiqNRrNFwYpBX/mMD69h2h1o9klPpnZ2oN4A2P/tWg85vFGl 3/xvPDcLYmGSOGIgPLw2vMyuwhH16YNcOG9p+JMw= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sun, 04 Feb 2024 18:26:50 +0100 Subject: [PATCH 4/4] power: supply: core: drop workaround for missing POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE 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: <20240204-power_supply-charge_behaviour_prop-v1-4-06a20c958f96@weissschuh.net> References: <20240204-power_supply-charge_behaviour_prop-v1-0-06a20c958f96@weissschuh.net> In-Reply-To: <20240204-power_supply-charge_behaviour_prop-v1-0-06a20c958f96@weissschuh.net> To: Sebastian Reichel , Hans de Goede , Konrad Dybcio Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707067615; l=1735; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=IxAmxaUd639konem1J0CwPySbGfu/rKfRx4PF1P1Nfs=; b=nN0rW/JGrCJIb+/x9MMDNSXtBsocp2ba6MNqVU656ezGH4x7jbknMB4pZdT5XLMbyMKZpfAv/ xTfUVOKIqxuBsXEyAmgaOaqbxZu9C4OO3LwGLhgoc6rpM2OGRubm+X9 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= As the mm8013 driver was extended to also report that property the workaround is not needed anymore. Signed-off-by: Thomas Weißschuh --- drivers/power/supply/power_supply_sysfs.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index 3680cfc2e908..3804a3bbed24 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -273,7 +273,6 @@ static ssize_t power_supply_show_usb_type(struct device *dev, static ssize_t power_supply_show_charge_behaviour(struct device *dev, struct power_supply *psy, - struct power_supply_attr *ps_attr, union power_supply_propval *value, char *buf) { @@ -289,9 +288,7 @@ static ssize_t power_supply_show_charge_behaviour(struct device *dev, ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR_AVAILABLE, &available); - if (ret == -EINVAL) - return sysfs_emit(buf, "%s\n", ps_attr->text_values[value->intval]); - else if (ret < 0) + if (ret < 0) return ret; return power_supply_charge_behaviour_show(dev, available.intval, value->intval, buf); @@ -337,8 +334,7 @@ static ssize_t power_supply_show_property(struct device *dev, &value, buf); break; case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: - ret = power_supply_show_charge_behaviour(dev, psy, ps_attr, - &value, buf); + ret = power_supply_show_charge_behaviour(dev, psy, &value, buf); break; case POWER_SUPPLY_PROP_MODEL_NAME ... POWER_SUPPLY_PROP_SERIAL_NUMBER: ret = sysfs_emit(buf, "%s\n", value.strval); -- 2.43.0