Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1099710pxv; Fri, 25 Jun 2021 05:34:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKfcxoq6gPtaxuTQkm6QStt8WKvHJSVTqI0WlktxhbTA79d/P1/3mA3UgzFSVPqvgldCRc X-Received: by 2002:a05:6402:1508:: with SMTP id f8mr14040296edw.172.1624624495477; Fri, 25 Jun 2021 05:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624624495; cv=none; d=google.com; s=arc-20160816; b=DWiK7cVjkkQkcQTBOr9skl7wP5dbHD8OiwhMdXn34IRNYkSplnVzKwrE1OhixVKXeb cZwkisaV2l2UY2SX2ghJlzwfmxD/uCMup2TiL+hYvdlO0UC6nJ/DmIdrIa/qniXf2WIZ Ulz6ARul0D7CwVlXiLFCB9FTcJmukkHylXu3lZJOZ7zvjOwitCwazFlcxXBbtTmcAW5/ umoOxHMGQuNUB+vz2wIv2qMbvBy+6bqMSQ0gUA3D34SzcWn1DnFHZuR4MjwNyGeedTNc FS/sEBx59St7K5/PD0Dc6c+hTj858/cJlbEvMLQ2OhunOnRaeZfxMqysTpv9rGgX/wnD /xuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7uTpeNDt6hPhfzIpRWDgXze0mbsew40+reH6QWRRbt8=; b=DAfdWQLggvcMrGAumQkzUhgnjQIHsYgTkVkbXr/VL20Nyz7iDHNB+imF/X+97ytB/H 4yycsasKKL9syn2alqiEm1GxCbQWQH4teCo1IeJS6Y8JX/kTz7PvhukJ1tFse8CcdcQp VeCaxRlk+wAyGgwLaK1JCXMZxrUZ+yIH/RisFrzkkb6floX91N2/2cenkY4mCsK6bmy6 LVLDDlVbTJGOfZYXtzyYgM/sbhsrNngqRXQHZhlayONl3pxTY3z1cyxn93oY7SQEwIEd toyoqyTkd4jR3qdn4VV6PjhKV1cYBXF+trsu+foV53IwTGBG4nduYnpHR00QkBZerSxN Wd7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b="QzHH10/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si3102578edd.587.2021.06.25.05.34.31; Fri, 25 Jun 2021 05:34:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b="QzHH10/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231474AbhFYMcp (ORCPT + 99 others); Fri, 25 Jun 2021 08:32:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbhFYMcg (ORCPT ); Fri, 25 Jun 2021 08:32:36 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C320BC061574 for ; Fri, 25 Jun 2021 05:30:14 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id gn32so14898862ejc.2 for ; Fri, 25 Jun 2021 05:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7uTpeNDt6hPhfzIpRWDgXze0mbsew40+reH6QWRRbt8=; b=QzHH10/Zg6e5jKltX9Y2D8emidFs4HE9iZT6Kd3VfcTAayU/MHVhTfYr3ML3S3cMp3 nvTUXxYfGCDHtfQQwMyLyUAGJI1N6s3UxVL61F7ZeBR62BIitESp8Ub9bhkwAJmBseeZ s3LcPNmmVFce24ANxn3HUe/So26xNQAF2v51AaB/qp6d7jnHwparaX9uHhjZiL5egSBI Nql/m8nN/ZSmORaPbB92OmMyZGkQKMRjHkD2ZNR0kB/LfdFhsD1PbzIVUU9WGzL+eOJ8 Ysx3M5joZTj+pXi2c6hPRUOh4Ras0KKDVMRjIDWeBkC/HFkImz0dHhZRjXOuV05aNMbT 93gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7uTpeNDt6hPhfzIpRWDgXze0mbsew40+reH6QWRRbt8=; b=P//j4yVYzw6lloNVkZVzG2PjBGuAhIelf9pRBy9XFBSNZRyv1hzunsCnGnMimbQ2R2 01ybhvCdI/BMdq7DY8SkDhCScRFUpJvu0uJdDUHp1dm+3AKj7CiDH4nRUBj18QtliqI5 U3yEUbliJp07yXJBDxZbi8FCHkoOlTgJVbFb9zjaYS/3DRlgRGd1LWP+kS4SFh0f2PrD x2R+61bs8ip6hC7RPHrjLmZFPwbQKVinwZj5NKEdl9lQO52baheQs9vlu5uvw4jWf8Ab JiA3k/vX8VsSn19YOAdauQZnwLmJn07mNNEZVGbV1lV/bbX4MiA2Xhx96kI7WYNYiIGb xwCQ== X-Gm-Message-State: AOAM532MkgasDbALK0aiDue4cMuyZg4HB0u7RSCVwb4/1NptQxdQdQrG pgJ91yn8SDacGCoHOeGPo1I3MQ3EhJD5eOmWYLE= X-Received: by 2002:a17:907:2622:: with SMTP id aq2mr10761449ejc.48.1624624213109; Fri, 25 Jun 2021 05:30:13 -0700 (PDT) Received: from neptune.. ([5.2.193.191]) by smtp.gmail.com with ESMTPSA id c15sm3884351edu.19.2021.06.25.05.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 05:30:12 -0700 (PDT) From: Alexandru Ardelean To: linux-kernel@vger.kernel.org Cc: lgirdwood@gmail.com, broonie@kernel.org, Alexandru Ardelean Subject: [PATCH 3/4] regulator: devres: remove devm_regulator_bulk_unregister_supply_alias() Date: Fri, 25 Jun 2021 15:23:23 +0300 Message-Id: <20210625122324.327585-4-aardelean@deviqon.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210625122324.327585-1-aardelean@deviqon.com> References: <20210625122324.327585-1-aardelean@deviqon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This API hook isn't used anywhere and most-likely exists because of the general principle of C APIs, where if an API function does an allocation/registration, it must also have an equivalent deallocation/deregistration counterpart. For devm_ functions this isn't all that true (for all cases), as the idea of these function is to provide an auto-cleanup logic on drivers/system de-init. Removing this also discourages any weird logic that could be created with such an API function. Signed-off-by: Alexandru Ardelean --- drivers/regulator/devres.c | 24 ------------------------ include/linux/regulator/consumer.h | 8 -------- 2 files changed, 32 deletions(-) diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c index bf0d19a7fb69..007855ae165b 100644 --- a/drivers/regulator/devres.c +++ b/drivers/regulator/devres.c @@ -344,30 +344,6 @@ int devm_regulator_bulk_register_supply_alias(struct device *dev, } EXPORT_SYMBOL_GPL(devm_regulator_bulk_register_supply_alias); -/** - * devm_regulator_bulk_unregister_supply_alias - Managed unregister - * multiple aliases - * - * @dev: device to supply - * @id: list of supply names or regulator IDs - * @num_id: number of aliases to unregister - * - * Unregister aliases registered with - * devm_regulator_bulk_register_supply_alias(). Normally this function - * will not need to be called and the resource management code - * will ensure that the resource is freed. - */ -void devm_regulator_bulk_unregister_supply_alias(struct device *dev, - const char *const *id, - int num_id) -{ - int i; - - for (i = 0; i < num_id; ++i) - devm_regulator_unregister_supply_alias(dev, id[i]); -} -EXPORT_SYMBOL_GPL(devm_regulator_bulk_unregister_supply_alias); - struct regulator_notifier_match { struct regulator *regulator; struct notifier_block *nb; diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index fb653d2a11f0..10ff6b66ca9e 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -230,9 +230,6 @@ int devm_regulator_bulk_register_supply_alias(struct device *dev, struct device *alias_dev, const char *const *alias_id, int num_id); -void devm_regulator_bulk_unregister_supply_alias(struct device *dev, - const char *const *id, - int num_id); /* regulator output control and status */ int __must_check regulator_enable(struct regulator *regulator); @@ -420,11 +417,6 @@ static inline int devm_regulator_bulk_register_supply_alias(struct device *dev, return 0; } -static inline void devm_regulator_bulk_unregister_supply_alias( - struct device *dev, const char *const *id, int num_id) -{ -} - static inline int regulator_enable(struct regulator *regulator) { return 0; -- 2.31.1