Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1408919lqa; Mon, 29 Apr 2024 07:46:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVffyCTK7KyEVkMz3dONYQs8VSmi6B39qAPeNLQGawY7m8OllU5dasNIEcmDoQvC5b89F7LtAS3q4hL/QUh9y4qss7tf/L2lndyaiu8lA== X-Google-Smtp-Source: AGHT+IEy/twmfwZ04ozWwCFJAetHrA8KABjiGQ/fO+DzIjKgrYmZ5wfTiHjIGSyl7DM/vtDIhd1M X-Received: by 2002:ae9:c304:0:b0:78e:f3d9:6c41 with SMTP id n4-20020ae9c304000000b0078ef3d96c41mr11974449qkg.22.1714401980250; Mon, 29 Apr 2024 07:46:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714401980; cv=pass; d=google.com; s=arc-20160816; b=sBUkWcujGMAtAwXYdAIvJUyky5YWbX+csqpinWO67+lkt3OaPe9DjtJLK9VG63NNRH xf96IaF0Nu5MqUsvKqs3E9zrUNRfTz3t0cg0FkUsKzswY61wnYQQKMwMM73/9PNDXfgp DXuZWKp4tWXzq887rSeftS54AR5QSP9C9VdnqAaRUj2I73m1PIBj3VZKzur7nAFhQt6h OT+iEwaNi329sj3IdNtHsVM9LAMHItclk0YADehBaeF/HOP0lPOSA29s9AuoBZ4s6i5V WbRFCn1eqaFg8qTxiiEMT90VYGxx6by/ndOuX9C0HlldyIbGBNGztyw9To//fOVz6NAa Peng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:dkim-signature; bh=QWPcDRg/dydRuLfjKjyfO14q4cRUSf5IeGYMczLYYGQ=; fh=9+JPiKUqmiwg7nrgynbn+qu8x0UhUJwyp0gAHVwwYQs=; b=e7vAJQgv3jIwtMdHaJrCt2BxA0Mi4WKpG8Yp3t0OTpDq5L7g3vSoiLQV6XJDcp73Uo HxH4Qb2+asA2yU4yLjSXPCRM9ycUO0MKA662M96r0QItVsCjIy732eJzE3G6FbQ11+Ny D2Op/jFBIMkoxaGDrrY1GzDm7GtbIoIHTJOTbmXPvqXaSDqE7dY/Pf2eC++3HLCv5Fj1 lJNI7diFz0/16fC+k5xv8A4orcyaDeg+hZ9fekTWTLXRxnOss0K9GPaTOKKh0zZgRax3 wDBCmRJsvVH/pj1fMFI77jvti+gdxnRhLtBsCX5W5mEdZToJGRmNZfbMRAo31CJkfNc0 hCzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=cNpCRKZT; arc=pass (i=1 spf=pass spfdomain=rere.qmqm.pl dkim=pass dkdomain=rere.qmqm.pl dmarc=pass fromdomain=rere.qmqm.pl); spf=pass (google.com: domain of linux-kernel+bounces-162474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cz52-20020a05620a36f400b0078eb9b45f48si26005711qkb.308.2024.04.29.07.46.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 07:46:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162474-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=@rere.qmqm.pl header.s=1 header.b=cNpCRKZT; arc=pass (i=1 spf=pass spfdomain=rere.qmqm.pl dkim=pass dkdomain=rere.qmqm.pl dmarc=pass fromdomain=rere.qmqm.pl); spf=pass (google.com: domain of linux-kernel+bounces-162474-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl 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 F1D7B1C20C7C for ; Mon, 29 Apr 2024 14:46:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A28382877; Mon, 29 Apr 2024 14:45:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b="cNpCRKZT" Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) (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 B54797EEF3 for ; Mon, 29 Apr 2024 14:45:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.227.64.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714401940; cv=none; b=NincPjF+qOtD+r1AaSQRanOn+o19WVbvMNolffhUmYcQ1JaLJl7ylk1rXPseI4i7A6+hM1NI0Ns8lWd+96YhYKsj0K0v3OMS/HT0uOSIz4KntILqOLQ/ByYOTtRVrnowC3rZGhuJq8+qCJK0ZJUM1VdM//Oc5atB63DG+Vuqy+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714401940; c=relaxed/simple; bh=4JtJTSbLrjwGebjthC7c0OCkQzqG8Bgaqe/Z3Spl0fM=; h=Date:Message-Id:In-Reply-To:References:Subject:MIME-Version: Content-Type:From:To:Cc; b=ffQwr3jnjGxy8/E7oowSbNzAsAAwJinjIzDNsuiSekuKRXO71wRCifIDrJRnjNdf73LfCHrXP5fETGwN3/upiq1uvlRc7DzI77TgLLZoBUL5PmgfCIvynGWiSoHoEcKfdx2kEm+9zZSb4rHL/8YIqEkBMOUyK/CaWlAdRUUgUOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=rere.qmqm.pl; spf=pass smtp.mailfrom=rere.qmqm.pl; dkim=pass (2048-bit key) header.d=rere.qmqm.pl header.i=@rere.qmqm.pl header.b=cNpCRKZT; arc=none smtp.client-ip=91.227.64.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=rere.qmqm.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rere.qmqm.pl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1714401933; bh=4JtJTSbLrjwGebjthC7c0OCkQzqG8Bgaqe/Z3Spl0fM=; h=Date:In-Reply-To:References:Subject:From:To:Cc:From; b=cNpCRKZTS4BT2Od/tQPePf91WPup7BuhEp3AVYFZFz9c5JCdKO4qRNMTCzKcgSe6D W0lWHX3wjCC0RUZB1bPj6nl5w4lKjtx0vLcB6MTI3Mq/zJjphah1DMDtgmcuHK8Tpy kHWfmXJl+WzlHiOmI0WYQfogbEErXjXmHhFQd8ueAEyjxMia03mPSkti3q2ZF+ZGZf bHFpPRfnMW8OePhcquVFtGNlPED7rPf0UobN8IEKueDi/xIIpMMIPIvbGrtYg835T2 3F+UeNrfT0hQXJNWZVCObFFLMZ5/ilZez1jZ32DD0qh30VxtJ8jWLKMytjt2JpU4un ZttaTsMPR1lBQ== Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4VSmMx487bz1M1; Mon, 29 Apr 2024 16:45:33 +0200 (CEST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 1.0.5 at mail Date: Mon, 29 Apr 2024 16:45:33 +0200 Message-Id: <0a480abe4913f0169f9693f6f959fbe1a397ae93.1714399603.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: Subject: [PATCH v2 12/12] regulator/core: use rdev->dev.driver_data 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 From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= To: Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org Move rdev->reg_data to rdev->dev.driver_data to follow the linux device model more closely. Signed-off-by: Michał Mirosław --- drivers/regulator/core.c | 15 +-------------- include/linux/regulator/driver.h | 8 +++++--- include/linux/regulator/machine.h | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 010f4db2ce60..ea2a5efd9a4b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -5630,7 +5630,7 @@ regulator_register(struct device *dev, } ww_mutex_init(&rdev->mutex, ®ulator_ww_class); - rdev->reg_data = config->driver_data; + dev_set_drvdata(&rdev->dev, config->driver_data); rdev->owner = regulator_desc->owner; rdev->desc = regulator_desc; if (config->regmap) @@ -5895,19 +5895,6 @@ void regulator_has_full_constraints(void) } EXPORT_SYMBOL_GPL(regulator_has_full_constraints); -/** - * rdev_get_drvdata - get rdev regulator driver data - * @rdev: regulator - * - * Get rdev regulator driver private data. This call can be used in the - * regulator driver context. - */ -void *rdev_get_drvdata(struct regulator_dev *rdev) -{ - return rdev->reg_data; -} -EXPORT_SYMBOL_GPL(rdev_get_drvdata); - /** * rdev_get_id - get regulator ID * @rdev: regulator diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index c1334601cf02..680c23b13249 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h @@ -632,8 +632,6 @@ struct regulator_dev { struct delayed_work disable_work; - void *reg_data; /* regulator_dev data */ - struct dentry *debugfs; struct regulator_enable_gpio *ena_pin; @@ -707,7 +705,11 @@ void regulator_irq_helper_cancel(void **handle); int regulator_irq_map_event_simple(int irq, struct regulator_irq_data *rid, unsigned long *dev_mask); -void *rdev_get_drvdata(struct regulator_dev *rdev); +static inline void *rdev_get_drvdata(const struct regulator_dev *rdev) +{ + return dev_get_drvdata(&rdev->dev); +} + struct device *rdev_get_dev(struct regulator_dev *rdev); struct regmap *rdev_get_regmap(struct regulator_dev *rdev); int rdev_get_id(struct regulator_dev *rdev); diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 7c39dbc33290..378f051d4e70 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h @@ -274,7 +274,7 @@ struct regulator_consumer_supply { * @num_consumer_supplies: Number of consumer device supplies. * @consumer_supplies: Consumer device supply configuration. * - * @driver_data: Pointer copied to regulator_dev.reg_data. + * @driver_data: Pointer copied to regulator_dev's drvdata. */ struct regulator_init_data { const char *supply_regulator; /* or NULL for system supply */ -- 2.39.2