Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp465182rdb; Thu, 15 Feb 2024 05:52:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJTkNTrqliBlvbI8/g3/2Sz0I4olF/dlnwAjT4rHJ87jzlpIu/nXpP1nTfIU7JcPzb+4naTXv1rYIC6AC1M1O45hSFXivpRGiaelR4Sw== X-Google-Smtp-Source: AGHT+IHs8YJdK1i9Wz6xO7wAFJWM1fHdbaUjuvRNhUbaVuG2a2f25N2E+VK/WBaCyp5ldCdQX8E+ X-Received: by 2002:a17:90a:5315:b0:298:9adb:1e80 with SMTP id x21-20020a17090a531500b002989adb1e80mr1803853pjh.21.1708005172045; Thu, 15 Feb 2024 05:52:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708005172; cv=pass; d=google.com; s=arc-20160816; b=bK6JjyhpoAiGVEJppQBPuxvZdxqcXQgq9S3nQdNz8HG35o29FHt8QraoQxNPU39VFw k5OWdbeLYQO+Hf2m26GN2wfHRmQn8RMCFeUtfmOoiXA1ejzN6sSgEsBmqj3IYG3y6P4A 4cbAYAwonhHb316wYXIiKO/Y4jEmzAd2EVMQjxsiB5qTs3VXFbg5pen0D1CRotubbZhQ lRAxppQbQUAlwQhMHGX88e43CqDIEgMD6cvfs8SIMJhP24Xk7bVeNRn2HYhZCEZsZzp6 rd25xcq6GKn6aLocvb8l64qAgcmId3hZw3AqjtJnEC+4DgPraKkGTgawpepQ7TPuhHMn 687w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=dLp+XLTC45kl9uPUDcVThb/Bg7QaETSkZjWu1tJKY5Q=; fh=FdZaWm9HVp6vTufomMZOleyIvg0+ax5kVvdPQlnV24Q=; b=0PazTyZGDZqbKP87TtDLNl199/hTNZt2+yb0ZVQGGIrRPFwXrpGiTYLfjXFjcwlEYj +zC+yUNvrBfnX/cRhVjVDmTe3EcWVz+EakvhUyGpUeV3SwbKPZmvUsgLlYNQKz7YP+RL SCI5cPU41IuI5z4xguBtw8gnIzcajIhWnuH1T8C79GVCefDtCeOIXJA3du3HTAeUG4Ey lUo1RWu0zEuF5sBgZ8e0O+tNKg1zerRRqSOoeZsl+a7zyUMM9XCQ2NuqZLKEjRcMYXD0 dJrS1VWocJZsBKKGw73XvpMOxJVl8j3iffDRa9E8GfKoTA+0w1jNmC9SJ4Uu8pZK8MQP Xbew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-66956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66956-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i10-20020a17090adc0a00b0029909da2167si1076296pjv.32.2024.02.15.05.52.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 05:52:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-66956-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66956-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EFF71B2AEA1 for ; Thu, 15 Feb 2024 13:11:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11D1512FF63; Thu, 15 Feb 2024 13:10:56 +0000 (UTC) Received: from michel.telenet-ops.be (michel.telenet-ops.be [195.130.137.88]) (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 EC02012D751 for ; Thu, 15 Feb 2024 13:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.88 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708002655; cv=none; b=DRKYWH1QU/NPgtRUsATS6N/yvbTeoYE28zkHGjOBoH+d4K32Hw9i1I0r3JXXkVo1BuEaOYXid0B/+Bx8s+7ZCOIFKwQtzECacPF7zxBr/V7fGZQ3vWX5z+usVKaZE05LRUWq/oYpmz2jK1Ci+zIK8mXONDL24aOaHkhAK+VPiVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708002655; c=relaxed/simple; bh=yjbAE2nc8iNV6y/AHrAwq9EGZuheR7TP6U4f67OjgLE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UN79Chu4Q6n5IENzonFNqA/fGax+6U656zIIrcHRGDR+eMg+yIxqZ2If88VfDUN8EwWoJuujeiKyAjvByaOkomKU1uqAS1dkKSkyqy8mBtEu7OCX7GADxIKax7bA4BPC/QGUHBskHd4WS/W2adRTqe9BHdBVoGUZxnTmoDtgnUw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:ac52:3a54:2a84:d65a]) by michel.telenet-ops.be with bizsmtp id nRAr2B00J0LVNSS06RAsyc; Thu, 15 Feb 2024 14:10:52 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1rabVk-000gy6-FC; Thu, 15 Feb 2024 14:10:51 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rabVr-00HZQt-Pc; Thu, 15 Feb 2024 14:10:51 +0100 From: Geert Uytterhoeven To: J Keerthy , Liam Girdwood , Mark Brown Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2] regulator: lp87565: Use bitfield helpers Date: Thu, 15 Feb 2024 14:10:50 +0100 Message-Id: <5e8781d31c983caf6bdabe36c5552077422cb8da.1708002575.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use the FIELD_PREP() helper, instead open-coding the same operation. Signed-off-by: Geert Uytterhoeven Acked-by: Mark Brown --- Compile-tested only. v2: - Add Acked-by. --- drivers/regulator/lp87565-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/lp87565-regulator.c b/drivers/regulator/lp87565-regulator.c index 61ee5cf3f2411fae..1259b5d20153658b 100644 --- a/drivers/regulator/lp87565-regulator.c +++ b/drivers/regulator/lp87565-regulator.c @@ -5,6 +5,7 @@ * Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com/ */ +#include #include #include #include @@ -99,7 +100,7 @@ static int lp87565_buck_set_ramp_delay(struct regulator_dev *rdev, ret = regmap_update_bits(rdev->regmap, regulators[id].ctrl2_reg, LP87565_BUCK_CTRL_2_SLEW_RATE, - reg << __ffs(LP87565_BUCK_CTRL_2_SLEW_RATE)); + FIELD_PREP(LP87565_BUCK_CTRL_2_SLEW_RATE, reg)); if (ret) { dev_err(&rdev->dev, "SLEW RATE write failed: %d\n", ret); return ret; -- 2.34.1