From patchwork Wed Jul 10 06:45:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13728939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D47FC38150 for ; Wed, 10 Jul 2024 06:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7aZECrEA5tQWlK6pbaSqNy3VIVWi6gzN6CRcwSGtkk8=; b=GpIptPo5cf+ptUq917zdAr6p6h PhBkd9PX+2hujSNMKF5BqGFwZj/QFJMtSXtimBzipr2qs8PMGXdoTH30gotD06k6HA2b7LG7u/bY/ oWsIKPUDN8s5kA+LPlhREatyZWDIvH83yKXb4ceZu+jUyWVvvEkZIELp8qKiuZSZ4MhB6Nsjo6nVF ByCw/Ftt4d62+iY8IdWn6gtNCCsVQifMsnA2IT7Cv451gmAV4zNfzFGxo0Bb/M5GdK6cijqktYizt HqWrhKxOopD2qzmdyAWp7CFDVgVk1i1gG9OpXIVrzQ9iFnOw4GCvRjpZQeMI2VrGDlB8I7tQQGyEe 8ZDx8Oog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRR59-00000009dkn-3Iqh; Wed, 10 Jul 2024 06:45:39 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRR4u-00000009dhk-1cn0 for linux-arm-kernel@bombadil.infradead.org; Wed, 10 Jul 2024 06:45:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To:Content-ID:Content-Description:In-Reply-To:References; bh=7aZECrEA5tQWlK6pbaSqNy3VIVWi6gzN6CRcwSGtkk8=; b=kn6Y/B5c1sEreb9xU2UajIrkOt X2fEZktnGlCKIOrcG9OVg2UqxxgStRkLlhGietCSpRLxhBAO1G2bIKR60oHLV9lXciPu7bDA7EfGh F7iMqmZUSbWCTsochY/wMhqu3kmR7cUuEg6x6WWUzb4rZehWmctUWhw7o6teFKMzJGfIvMrxLU5jd MI0+qLV8icxPz5fjUdXsUOjQtisqVLP0ypVVgEv9SFmkOyZ24T2U4d48FRF08Huw4i42mPkONIM7T xUcUqT7JRo6GkGrOikSBELm8nmECpSY5KecZd46CHosBSLY02knyKh04zmaqduv+BfR5D7BM1Wugf 0vm467lA==; Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRR4q-00000000rsA-2ubJ for linux-arm-kernel@lists.infradead.org; Wed, 10 Jul 2024 06:45:23 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a77d85f7fa3so70881966b.0 for ; Tue, 09 Jul 2024 23:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720593917; x=1721198717; darn=lists.infradead.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=7aZECrEA5tQWlK6pbaSqNy3VIVWi6gzN6CRcwSGtkk8=; b=IIYGEgk01zc37xXRMBvvsVNigFiCFDG2EBVYNbNT1yW6FfCGBiVbmmxcykj2z5bXmd x2mZ55qiM75HQJxYoYQ8NZUBpENqDFc1hoW2TQ9ttM93lDRLeXx2Q3jmTPsPe9Fz9+sq ss6JnaMDR673Xi8XsGvjUMWs3GgTBTvDVD8YWP6XQrtvVjKMR7uIai9/xG61N3XUs+tO Bi0IW7Jo1kY/eQr7BXbF7dgCv83a+pLgwgD/V/9JJ6IR31Ohr3k6l7hsSiwmRVCv12zP e9cDvSsFVISYjhqyC1g93II52Ysp6oJobUfECemMjK7Arp7lTpOQYrVzyOM+z3iQjNXS VazQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720593917; x=1721198717; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7aZECrEA5tQWlK6pbaSqNy3VIVWi6gzN6CRcwSGtkk8=; b=AP7yoVQscHbeTgPKbKVql8jt5mx7qQzcrafJTwopROQaRyHMUYIeKtxgmYsjNY6I99 +3rKdCHpZdef+8hm0N3/N2MBMV9S6yLWPJhAy/DZ0sWCQcKdIOIBFTAqYJkhLb5m8jx4 UHeTCb/eMsQcRvKLN+WSgibZMWA35lS4YZbWzw15eqx3NYcEo8CB//j8xYW/N8xRF/jk yWXSU1LlIuPO6ueKXLDWcx3imEuegPhfNayVbdDofVfo7+oG4uRnq2Ma2O8GbEjl6Q3l W/r86/82KDuSvbr3HU7l63iVrLTI/bjPgUiJfcTfIYvQOzO1cR7nHPQ6YQ56ORoPdIR4 j8Cg== X-Forwarded-Encrypted: i=1; AJvYcCU5S9sTmv2cTBLo6PqIBJH6kBYBoTKYMzZR35Z1u4IPCqM+BWnrlqQm9IwO/bY0IL1GwIiyU+tt5cs7t6RkW0F3ylz1A5Havcafyl2LRwDble5IOpI= X-Gm-Message-State: AOJu0YxaDjk46ykohVEPjBoSHuPKem5hfQ8L3GvUMnqsBX8ebd9YGMtr RH9d/gTDPG+Q3XfCid4nExl70rbrf+e0knNK7I7cymO74YOV5y2qn6ZtVnvEZug= X-Google-Smtp-Source: AGHT+IHw00t1Zg30xrx1hACKh7awa0kbStIosk2q3dxs2TJLXa5CTmZFvqt9t2YMS5YHAWLuzCeAww== X-Received: by 2002:a17:907:60d2:b0:a6f:e0f0:d669 with SMTP id a640c23a62f3a-a780d218c40mr341081266b.12.1720593916943; Tue, 09 Jul 2024 23:45:16 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a86f620sm132214766b.209.2024.07.09.23.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 23:45:16 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 10 Jul 2024 07:45:07 +0100 Subject: [PATCH] phy: exynos5-usbdrd: convert some FIELD_PREP_CONST() to FIELD_PREP() MIME-Version: 1.0 Message-Id: <20240710-phy-field-prep-v1-1-2fa3f7dc4fc7@linaro.org> X-B4-Tracking: v=1; b=H4sIAPItjmYC/x2MWwqAIBAArxL73YLay7pK9FG55UKYKEQh3T3pc wZmEkQKTBGGIkGgiyOfLoMsC1jt7HZCNplBCVWLTgr09sGN6TDoA3lcqO21MpVWsoEcZbnx/Q/ H6X0/orbl02AAAAA= To: Vinod Koul , Kishon Vijay Abraham I , Krzysztof Kozlowski , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240710_074521_077322_DFA1B230 X-CRM114-Status: GOOD ( 10.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use of FIELD_PREP_CONST() was a thinko - it's meant to be used for (constant) initialisers, not constant values. Use FIELD_PREP() where possible. It has better error checking and is therefore the preferred macro to use in those cases. Signed-off-by: André Draszik Reviewed-by: Sam Protsenko --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- base-commit: 82d01fe6ee52086035b201cfa1410a3b04384257 change-id: 20240710-phy-field-prep-be6982d38215 Best regards, diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index df52b78a120b..0cc5c4249447 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -607,7 +607,7 @@ exynos5_usbdrd_usbdp_g2_v4_ctrl_pma_ready(struct exynos5_usbdrd_phy *phy_drd) reg = readl(regs_base + EXYNOS850_DRD_SECPMACTL); reg &= ~SECPMACTL_PMA_REF_FREQ_SEL; - reg |= FIELD_PREP_CONST(SECPMACTL_PMA_REF_FREQ_SEL, 1); + reg |= FIELD_PREP(SECPMACTL_PMA_REF_FREQ_SEL, 1); /* SFR reset */ reg |= (SECPMACTL_PMA_LOW_PWR | SECPMACTL_PMA_APB_SW_RST); reg &= ~(SECPMACTL_PMA_ROPLL_REF_CLK_SEL | @@ -1123,19 +1123,19 @@ static void exynos850_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) reg &= ~SSPPLLCTL_FSEL; switch (phy_drd->extrefclk) { case EXYNOS5_FSEL_50MHZ: - reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 7); + reg |= FIELD_PREP(SSPPLLCTL_FSEL, 7); break; case EXYNOS5_FSEL_26MHZ: - reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 6); + reg |= FIELD_PREP(SSPPLLCTL_FSEL, 6); break; case EXYNOS5_FSEL_24MHZ: - reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 2); + reg |= FIELD_PREP(SSPPLLCTL_FSEL, 2); break; case EXYNOS5_FSEL_20MHZ: - reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 1); + reg |= FIELD_PREP(SSPPLLCTL_FSEL, 1); break; case EXYNOS5_FSEL_19MHZ2: - reg |= FIELD_PREP_CONST(SSPPLLCTL_FSEL, 0); + reg |= FIELD_PREP(SSPPLLCTL_FSEL, 0); break; default: dev_warn(phy_drd->dev, "unsupported ref clk: %#.2x\n",