From patchwork Tue Dec 10 22:48:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13902423 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37196211278; Tue, 10 Dec 2024 22:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733871089; cv=none; b=B2WS2OsmwfwLZgsYrzFtug4QNnaivQ8sbhlk55w7bkOXPx3+hORfZqcsGthlnlwKqrEfDyW6S/PQ9bIyuFlauFGzT8gQLXThAGOF/RkUTmOti5LNtnOox1Vc0smnteM6PQ2DJ/Z0Kd636hUu2aaF/BMMg8PFyAepYBDPMuDzkC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733871089; c=relaxed/simple; bh=8siJdl6SX9/0iyyOmBd/PiIKQzG6mbjhlgA9N2ypec4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DWszZfOJZmsqDc8WDb/SdE68IPtpJab6qxnfmvckLel6akdZKKOSnQRJ/nXjF1Q9VdM4nn1ipJjxcTdVogX1nvWiBapJ6N1EZfUarOMMymXPGM5D9Wi8mNybdCfoNMe19GX/PDDgmPgp+zgxh3wRkS93dIn8K8hwzGP0I10j0ZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LRVCd7za; arc=none smtp.client-ip=209.85.210.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LRVCd7za" Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-71e02eda71dso853670a34.0; Tue, 10 Dec 2024 14:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733871087; x=1734475887; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EP8TCa1W6Nwgx3e9Z8yLnkSmmFGmFeYQ1MSese63Hjo=; b=LRVCd7zab7Bcg9Er7vet2qcJXTGyNKJH3cU4S2fdeO3UwdKl7K0dpdyfRdgq4q2kcN DBQSdAgq5dfZTr6sbCG+7UjYmUkusc9yLXp08OfPg/HGRZgiTlv1jPGtYJE5bGCd+ctY sb3sPwvAr+stsTUI2m9zgiZLhZUsfqqUZO6DWL9Pay55ieHqyd9bTTYZj19E5Zg83JZa xLFr3vhNTv2sPbHjSYuvgvdQqAXhyj5C6TrWaaqK+v8a3D257ZwKleZVD/rsyJd18HJT 1TdT+iO0uVKTAcNBQhHGcZcqApWAZeS6L8ZlehRsNLs6EpFJDmTl+DzjhUKv3uFGYpsy Z4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733871087; x=1734475887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EP8TCa1W6Nwgx3e9Z8yLnkSmmFGmFeYQ1MSese63Hjo=; b=k0wQbdvxhSkPOrAxKmHZVZpfa4A90j1YDwNx8OvM8yInPJiv/Hdl6T6HIJrVlNcdWL bpzydgv7MLbSZcnqPlRAwMDI9XLu08lII/MsnTNey1p4EL8RWVjV/JPwUk7i+qJL/d3n l5LjBohvC18qyzPicg3suUdNms4B4ZaOKfI1CY0i3w60gYwqU1gaKEXyqYLpm6VurOeX Bm+Huf6CajuzEsfWjos5f+55GU/rVz28vPt0O6+AapuBe8shcv4gpdyvVeEte0dEiDYB 8Bt4URZ8T6aqUYUzMi0hJ1ROBmu1BPlxt545huE21lMvwA8LCoj+Y0JCpvHZD2vLozcq dyzA== X-Gm-Message-State: AOJu0YxTpBaESw79IaxJMXBRE6lDaUY0ZxjEG/GbZewTnsENkhJc6w/Z UGXaDpYO0Jqtka+ENdCmkRm1hic9EVx6jZ2DcXbf1eT7PpX6U0ACuJA40Q== X-Gm-Gg: ASbGncsZusjmQAkYngSequIkgVdqgu+bgJS0gSlTFtgQvjPUeJAuwi9HEhIY3ZNjSeI cwgE3Woa418F/kkGbuA5pagugOYLX3J+ety/jsZ/Xv/L0qF0l2X2+W1C1IxM9145X0b2+mokyYF BLmNKjYVhTbVSLDwvvzNQbutd9Jm/wQ5l0Hi1NC98p9VP/X3+5h0aDcasS3V9/XrpkDUL0p4Iqn N+VyZ0K/sIj/JeF/dg56hulW5aKakW2RYl3XRfPtudKTIkXb++F X-Google-Smtp-Source: AGHT+IEKKooqF1u/QzmyDqq0bvwQvz76TxS50uKHiht5smBqBgmx66Nxr4IF8Q8pSCJx6aFhiktM0A== X-Received: by 2002:a05:6830:63cc:b0:71d:5604:2084 with SMTP id 46e09a7af769-71e1979c403mr435806a34.5.1733871087146; Tue, 10 Dec 2024 14:51:27 -0800 (PST) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5f2a9d525f2sm1704136eaf.4.2024.12.10.14.51.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 14:51:26 -0800 (PST) From: Chris Morgan To: linux-pm@vger.kernel.org Cc: linux-iio@vger.kernel.org, andre.przywara@arm.com, lee@kernel.org, wens@csie.org, sre@kernel.org, lars@metafoo.de, jic23@kernel.org, Chris Morgan Subject: [PATCH 1/2] iio: core: Add devm_ API for iio_channel_get_sys Date: Tue, 10 Dec 2024 16:48:58 -0600 Message-ID: <20241210224859.58917-2-macroalpha82@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210224859.58917-1-macroalpha82@gmail.com> References: <20241210224859.58917-1-macroalpha82@gmail.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chris Morgan Some kernel drivers use the IIO framework to get voltage and current data via ADC or IIO HW driver. This is complicated by the fact that the consumer of this data is not a child of the IIO HW which current helpers depend on being the case. Add resource managed version (devm_*) of the APIs so that the client driver can call by name alone for the iio channel. Signed-off-by: Chris Morgan --- drivers/iio/inkern.c | 18 ++++++++++++++++++ include/linux/iio/consumer.h | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 136b225b6bc8..5df9e272743f 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -418,6 +418,24 @@ struct iio_channel *devm_iio_channel_get(struct device *dev, } EXPORT_SYMBOL_GPL(devm_iio_channel_get); +struct iio_channel *devm_iio_channel_get_sys(struct device *dev, + const char *channel_name) +{ + struct iio_channel *channel; + int ret; + + channel = iio_channel_get_sys(NULL, channel_name); + if (IS_ERR(channel)) + return channel; + + ret = devm_add_action_or_reset(dev, devm_iio_channel_free, channel); + if (ret) + return ERR_PTR(ret); + + return channel; +} +EXPORT_SYMBOL_GPL(devm_iio_channel_get_sys); + struct iio_channel *devm_fwnode_iio_channel_get_by_name(struct device *dev, struct fwnode_handle *fwnode, const char *channel_name) diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h index 333d1d8ccb37..bde075b5fb65 100644 --- a/include/linux/iio/consumer.h +++ b/include/linux/iio/consumer.h @@ -64,6 +64,26 @@ void iio_channel_release(struct iio_channel *chan); */ struct iio_channel *devm_iio_channel_get(struct device *dev, const char *consumer_channel); + +/** + * devm_iio_channel_get_sys() - Resource managed version of + iio_channel_get_sys(). + * @dev: Pointer to consumer device. Device name must match + * the name of the device as provided in the iio_map + * with which the desired provider to consumer mapping + * was registered. + * @consumer_channel: Unique name to identify the channel on the consumer + * side. This typically describes the channels use within + * the consumer. E.g. 'battery_voltage' + * + * Returns a pointer to negative errno if it is not able to get the iio channel + * otherwise returns valid pointer for iio channel. + * + * The allocated iio channel is automatically released when the device is + * unbound. + */ +struct iio_channel *devm_iio_channel_get_sys(struct device *dev, + const char *consumer_channel); /** * iio_channel_get_all() - get all channels associated with a client * @dev: Pointer to consumer device. From patchwork Tue Dec 10 22:48:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Morgan X-Patchwork-Id: 13902424 Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F413923A566; Tue, 10 Dec 2024 22:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733871090; cv=none; b=fqmypQOCtFrvbSnz8mm50QSwypXMgKl9IpvffN2FPbpKfsoioXY3Sp8FaG+JFSsVr58bxBOsQDmEMOSgQ18c40MqHHuNqfQW8XxNwICQy/L3N1sz4g+5asDGQ+RDjInQRF6jd7SsGZA2dkU/B2kGRLDpIbbNDGEu4VxamxxkxUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733871090; c=relaxed/simple; bh=n5pG/TYyBwfqRQtEQJbQZiEr58WKn9aE5efNPAZov7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Sl5nmXvPySSf4BOnFGNaNgKjRJscEuW94HNTL/DdmiFoz8U4zvUUl5AVR0zRHe1XOO1G/3fbuaRM93LOiBO0vsyfo0r5KzoCyE8FNia3Tt3/keicfm5KOe44f+lipyuD4HgI4357HklSUXswfCczBDHFf11nq067PswEhtNd7sA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DtboAx0B; arc=none smtp.client-ip=209.85.210.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DtboAx0B" Received: by mail-ot1-f46.google.com with SMTP id 46e09a7af769-71ddcdc445dso75953a34.0; Tue, 10 Dec 2024 14:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733871088; x=1734475888; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XWRlOS/1Rlfm48UyQ1PyZDHyVL86Gb45oXxEsMJ/ync=; b=DtboAx0B9Zy1ML6wAeMicEKSWRJNT+JBcpsXg/DTSQHVnol3BFX94WNcys9galOQm2 JWLyY1Oe+3N5vdY3eTThIFdG86qxCfMCrTNmpU+9pAZMooqypRWOy85GC61AvrymEuc8 /V5k28/1LqAlcXq4Oa1RpTTQqS3/Jhe7pl9DtaKmYCVAUIn9rwXfO+OsMNsweX1Pu4N4 z3efkUHl5mmyugFcY2TXulCIHdKCe1bk+eHCLccU/o81UyS8UMYErjhzeehV4rZVp9DX qGEwmNyxYCpR+EzV9FYaRGaHkus2KYP/mAVij4rPR7sLWt+1X3N043pDFO8Utt4wR0W+ bWHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733871088; x=1734475888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XWRlOS/1Rlfm48UyQ1PyZDHyVL86Gb45oXxEsMJ/ync=; b=sljfxqQB1Lzm8XxnJRPZ+jJ2gzGYNge4FZjHzuIr1Fo/2KRGxewm7x5UqJxXaZEgLg jfXC92QGFLF+PjYUvmbZzljUMziTR1RbOFVd/vlm0u/0YCXB37McyjVAA95w58He/aYL xcmmAtIXT/uFLcWyIzgsfa7HVrLrKZk1akmUYyp436JGkSvQB00+CFgwJHkg/Ck8iPYg UNuj7sGfuS0fpEa44S1Irp/4IOVVE7epTyjX4WtDCpKLg64r4h0o9CA+u8PAFT+TMzj6 1X+4pykaxdEyOq7yebwM/jvIk6HSEieayFBc1pdKpjBctr3NmR+DymDTHQ1cajTCltX3 9paA== X-Gm-Message-State: AOJu0Yxv2YBxbqSmaEcrXI/gBp3MHDkQ/PxgwYz3+gUbySb2lw1Btajx F7Pbr/kbX0q7ANIaOkwqt+bDhVHBZW51B5zyXk2vQedWNwSoBwRZIpGAkg== X-Gm-Gg: ASbGncsr4gLmlr1wfuNVak/gEHdoPBJodlGG7jsSofhTBuvTh5JyMn6I1nE4mbz5oID aW8e8wJq69CN85SbDJbF8monyyGhpKITsvgYtIQxDhmwG8bP9UimAAfkJHMxdUHNwla/oOjMmDx WIY/GApsBmQNdGXAZApQwEmKU6LP4O6isg9UXDyDC0geCh/40rO5KZvMWUtmIBdu0EOJO7tVpdd sdIqAIzMmaDIz8Fakweyw/Q3kZN2/gmN7x5XHMAcEyeMIqgOPC9 X-Google-Smtp-Source: AGHT+IGEiwxPq74eA4rSCC4kG14soSRpIJQDfPDrxZrNkVAU/bFf3Ano6imm6xa4F50w7uxedzW2UA== X-Received: by 2002:a9d:6a19:0:b0:71e:1d:5e09 with SMTP id 46e09a7af769-71e1a10e638mr238943a34.11.1733871087792; Tue, 10 Dec 2024 14:51:27 -0800 (PST) Received: from localhost.localdomain ([2600:1700:fb0:1bcf::54]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5f2a9d525f2sm1704136eaf.4.2024.12.10.14.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 14:51:27 -0800 (PST) From: Chris Morgan To: linux-pm@vger.kernel.org Cc: linux-iio@vger.kernel.org, andre.przywara@arm.com, lee@kernel.org, wens@csie.org, sre@kernel.org, lars@metafoo.de, jic23@kernel.org, Chris Morgan Subject: [PATCH 2/2] power: supply: axp20x: Use devm_iio_channel_get_sys() for iio chans Date: Tue, 10 Dec 2024 16:48:59 -0600 Message-ID: <20241210224859.58917-3-macroalpha82@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210224859.58917-1-macroalpha82@gmail.com> References: <20241210224859.58917-1-macroalpha82@gmail.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chris Morgan Since commit e37ec3218870 ("mfd: axp20x: Allow multiple regulators") the drivers for AC, battery, and USB have failed to probe when the option of CONFIG_AXP20X_ADC is enabled. This appears to be because the existing function devm_iio_channel_get() no longer calls iio_channel_get_sys(). Use the newly created function of devm_iio_channel_get_sys() instead. Fixes: e37ec3218870 ("mfd: axp20x: Allow multiple regulators") Signed-off-by: Chris Morgan --- drivers/power/supply/axp20x_ac_power.c | 4 ++-- drivers/power/supply/axp20x_battery.c | 16 ++++++++-------- drivers/power/supply/axp20x_usb_power.c | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c index e5733cb9e19e..07de889af16b 100644 --- a/drivers/power/supply/axp20x_ac_power.c +++ b/drivers/power/supply/axp20x_ac_power.c @@ -343,14 +343,14 @@ static int axp20x_ac_power_probe(struct platform_device *pdev) return -ENOMEM; if (axp_data->acin_adc) { - power->acin_v = devm_iio_channel_get(&pdev->dev, "acin_v"); + power->acin_v = devm_iio_channel_get_sys(&pdev->dev, "acin_v"); if (IS_ERR(power->acin_v)) { if (PTR_ERR(power->acin_v) == -ENODEV) return -EPROBE_DEFER; return PTR_ERR(power->acin_v); } - power->acin_i = devm_iio_channel_get(&pdev->dev, "acin_i"); + power->acin_i = devm_iio_channel_get_sys(&pdev->dev, "acin_i"); if (IS_ERR(power->acin_i)) { if (PTR_ERR(power->acin_i) == -ENODEV) return -EPROBE_DEFER; diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c index fa27195f074e..152e556a4417 100644 --- a/drivers/power/supply/axp20x_battery.c +++ b/drivers/power/supply/axp20x_battery.c @@ -906,23 +906,23 @@ static const struct power_supply_desc axp717_batt_ps_desc = { static int axp209_bat_cfg_iio_channels(struct platform_device *pdev, struct axp20x_batt_ps *axp_batt) { - axp_batt->batt_v = devm_iio_channel_get(&pdev->dev, "batt_v"); + axp_batt->batt_v = devm_iio_channel_get_sys(&pdev->dev, "batt_v"); if (IS_ERR(axp_batt->batt_v)) { if (PTR_ERR(axp_batt->batt_v) == -ENODEV) return -EPROBE_DEFER; return PTR_ERR(axp_batt->batt_v); } - axp_batt->batt_chrg_i = devm_iio_channel_get(&pdev->dev, - "batt_chrg_i"); + axp_batt->batt_chrg_i = devm_iio_channel_get_sys(&pdev->dev, + "batt_chrg_i"); if (IS_ERR(axp_batt->batt_chrg_i)) { if (PTR_ERR(axp_batt->batt_chrg_i) == -ENODEV) return -EPROBE_DEFER; return PTR_ERR(axp_batt->batt_chrg_i); } - axp_batt->batt_dischrg_i = devm_iio_channel_get(&pdev->dev, - "batt_dischrg_i"); + axp_batt->batt_dischrg_i = devm_iio_channel_get_sys(&pdev->dev, + "batt_dischrg_i"); if (IS_ERR(axp_batt->batt_dischrg_i)) { if (PTR_ERR(axp_batt->batt_dischrg_i) == -ENODEV) return -EPROBE_DEFER; @@ -935,15 +935,15 @@ static int axp209_bat_cfg_iio_channels(struct platform_device *pdev, static int axp717_bat_cfg_iio_channels(struct platform_device *pdev, struct axp20x_batt_ps *axp_batt) { - axp_batt->batt_v = devm_iio_channel_get(&pdev->dev, "batt_v"); + axp_batt->batt_v = devm_iio_channel_get_sys(&pdev->dev, "batt_v"); if (IS_ERR(axp_batt->batt_v)) { if (PTR_ERR(axp_batt->batt_v) == -ENODEV) return -EPROBE_DEFER; return PTR_ERR(axp_batt->batt_v); } - axp_batt->batt_chrg_i = devm_iio_channel_get(&pdev->dev, - "batt_chrg_i"); + axp_batt->batt_chrg_i = devm_iio_channel_get_sys(&pdev->dev, + "batt_chrg_i"); if (IS_ERR(axp_batt->batt_chrg_i)) { if (PTR_ERR(axp_batt->batt_chrg_i) == -ENODEV) return -EPROBE_DEFER; diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index 9722912268fe..c82f05cef379 100644 --- a/drivers/power/supply/axp20x_usb_power.c +++ b/drivers/power/supply/axp20x_usb_power.c @@ -577,14 +577,14 @@ static int axp717_usb_power_prop_writeable(struct power_supply *psy, static int axp20x_configure_iio_channels(struct platform_device *pdev, struct axp20x_usb_power *power) { - power->vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v"); + power->vbus_v = devm_iio_channel_get_sys(&pdev->dev, "vbus_v"); if (IS_ERR(power->vbus_v)) { if (PTR_ERR(power->vbus_v) == -ENODEV) return -EPROBE_DEFER; return PTR_ERR(power->vbus_v); } - power->vbus_i = devm_iio_channel_get(&pdev->dev, "vbus_i"); + power->vbus_i = devm_iio_channel_get_sys(&pdev->dev, "vbus_i"); if (IS_ERR(power->vbus_i)) { if (PTR_ERR(power->vbus_i) == -ENODEV) return -EPROBE_DEFER; @@ -597,7 +597,7 @@ static int axp20x_configure_iio_channels(struct platform_device *pdev, static int axp717_configure_iio_channels(struct platform_device *pdev, struct axp20x_usb_power *power) { - power->vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v"); + power->vbus_v = devm_iio_channel_get_sys(&pdev->dev, "vbus_v"); if (IS_ERR(power->vbus_v)) { if (PTR_ERR(power->vbus_v) == -ENODEV) return -EPROBE_DEFER;