From patchwork Thu Feb 15 13:10:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 201468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp410007dyb; Thu, 15 Feb 2024 05:51:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXb5TdyFsDv/TrAjbmrIn8aeBxgCdlH5j/NpAwF2o0tsI2ee2tl9QpWhfR8ALrRjvTFiOy4gtzDE9mynBkVeTdX76s5Lg== X-Google-Smtp-Source: AGHT+IECZ3Ovu8x47tEnVbJywe8mQyrWNRHiSBCJv4e6Acv7dz2RgblJ/VSn3jE2XqYYyEUGrFVh X-Received: by 2002:a17:902:a381:b0:1db:2d8d:914 with SMTP id x1-20020a170902a38100b001db2d8d0914mr1646757pla.53.1708005065069; Thu, 15 Feb 2024 05:51:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708005065; cv=pass; d=google.com; s=arc-20160816; b=IF3jrJb1P8e/nhDgkGdrl6t6uD62owSOF9sZ52Zk8azGo+Lclhqt1NhUSWMlOHxOe7 EQAKtZYwqpbhWX/ZVDpGcwjk3hgxtudy/G5neAmHESO4bgFypSVgiGCe4A6DNmQhNLva aThkkShcCxkdQDuL81CPL6tbHwL5b8jeOB6o95b0DUIth97+OWPh+aNYWcAJEpYqrO11 oLEUgX9EKlMXAcE2CpE9A++pCWTN5E6Dst1MX/QjaVIH/iwngNS3euKRCRlSThxWhhkG +qdANvrWl7M1AFmgYEDNxyqoo0+DqVvCvbsiJyu7l2gQbt2Qom8F9cOZTR9YUlkZWSHt rZ1A== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66956-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h5-20020a170902f54500b001d91df66e24si1186869plf.164.2024.02.15.05.51.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 05:51:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66956-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66956-ouuuleilei=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 18703B2B012 for ; Thu, 15 Feb 2024 13:11:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BCB712FF93; Thu, 15 Feb 2024 13:10:57 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790973119126515589 X-GMAIL-MSGID: 1790973119126515589 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;