From patchwork Sun Apr 14 07:15:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 789139 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E25A4208A9; Sun, 14 Apr 2024 07:15:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078934; cv=none; b=NiQ8538aW/Xunwnrjni45Bo8+XkB9/wa+LBmqddPfYTXbBH8ZcT6ALsh3TokdUNkabAq9CLwY66Ckhxn+b58WvVftene51gBcRIUoXtoRGWOQAjsB7UTmlMkxuLJJ1gQuDolRiqnOI4ctrFv+swdfgyeP+w4OAbxL7lWq3Qgkfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078934; c=relaxed/simple; bh=FSDsyMrRocq18g4fLSqC6+AUZYzqe2fK9hdMDuAh6QE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HSyoRIGOsmzgn+ZAZB2xg1AK0/t0+53U7dQl+IAHZnajkwxEWj7ozotJD4ByGpUqaFMSE+Sz8u+pU9Bt80zKBbxv7rLQ5eA5ZzUPlq1THbB/CoKnKQaA44vH9XJfP+XAa+Ki/acTuIKPJcgVS7RMeshnTGtQ0nIMudSvYaHl8/4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Yweem3i9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yweem3i9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B35D9C32783; Sun, 14 Apr 2024 07:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713078933; bh=FSDsyMrRocq18g4fLSqC6+AUZYzqe2fK9hdMDuAh6QE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Yweem3i9k23kIpTiylQql9UeaoUhbg9HuJLnI1sI7Qs0MgjbmkcBeecOsDbO1FEXG 6yjkZHPAUWPcexJeHHLWYAtWl3n+1iSkiJI6G0G7a/415bWfE3828c+c/jCDTaltp9 RjFeIXh+aMl+mZGYREy7xyVDORE76zz7UPqoJLg2N3wD/Hih8WGlZsTbPxdERVEk9m fdi4LGydC1UajTkHTB0eyho/eMcYE2CnEm3TJmL31E+oiLWoNnbZJDpd5ddiCJ/VAH h4QMSZki2hpNga/roAiBcrLXzqrX8iBYmp7sGBRpYVEd+E7mpMb39VH4pYgJg6YvyZ //B2L9Sh7wtIw== From: Krzysztof Kozlowski Date: Sun, 14 Apr 2024 09:15:14 +0200 Subject: [PATCH 1/5] mmc: sdhci-esdhc-mcf: Constify struct sdhci_ops Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240414-mmc-const-sdhci-ops-v1-1-178539d68093@kernel.org> References: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> In-Reply-To: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> To: Adrian Hunter , Angelo Dureghello , Ulf Hansson , Vignesh Raghavendra , Orson Zhai , Baolin Wang , Chunyan Zhang , Ben Dooks , Jaehoon Chung Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=797; i=krzk@kernel.org; h=from:subject:message-id; bh=FSDsyMrRocq18g4fLSqC6+AUZYzqe2fK9hdMDuAh6QE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmG4KJY/tl2Saj2U2DZ2YxrHCZv3dN/g6ktqpxk 423BMPWqEKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZhuCiQAKCRDBN2bmhouD 177xD/96a+pBFWX3uU4APgT7ya9+7pUYqrDvrDZezeiEu3NGdVD0o29a/S+Mxyh92BjF4oV9VmE TGMBjIZF2PbTc3I/YB5aRMSWlMJSP4IgTlGm197JZ/seqeQyAOK8Tc5J8PhRlA0QNsBr9mjqpeE fsVw21ffJcQKxkK3/5tlPpjLcUPvwYrf+nc4d3iaFDGPIRqFp6vw7ckRea1EJsx7EhJ91uThbmk cnbez1s4ycgieVDz3B2N/OKIehaz5lM5MM1GJrPCdN+m9d8UWAkbKZnjQ0a3qlQuRMYF4qA3nle EEoZ8Apt0rDKHjPP4FbBNgDVyIeKrUmY8Z6n1hMejG9PLFnXR0QTcwCYyTwxYA2eWTfAt2tm7BD 3JQDbypdM4sgHyi0RzFRre/JfB+4Nuu/UpD7oXza0p55DrEx8Sx1BL5hJXpxyssRQwMZMva6SnA OdSDkJLUql0bWGidIdzegMEHDa+yYO2dN766Qvy4o4kX7pG8vGl0JBeCz6j5B/5sMuz2J0pIDMV F3uf2eSdU6IdwFlGWzuUOjlZ5mB1396v1Y0JG6VdLF09uxZx5l3a5/IghFyHi0/0+OyTr1NHjqF wk5hWOxe8gT2x5yfxALM3+Vav9NWp+lvGK5VrIhjzL0IiZp/brHXDGkG/HPoJk/8KFZbtEXJFF6 ukmn8TMymrQ3Gmw== X-Developer-Key: i=krzk@kernel.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The local struct sdhci_ops can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/mmc/host/sdhci-esdhc-mcf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-esdhc-mcf.c b/drivers/mmc/host/sdhci-esdhc-mcf.c index c97363e2d86c..3ad87322f6a5 100644 --- a/drivers/mmc/host/sdhci-esdhc-mcf.c +++ b/drivers/mmc/host/sdhci-esdhc-mcf.c @@ -335,7 +335,7 @@ static void esdhc_mcf_copy_to_bounce_buffer(struct sdhci_host *host, data->blksz * data->blocks); } -static struct sdhci_ops sdhci_esdhc_ops = { +static const struct sdhci_ops sdhci_esdhc_ops = { .reset = esdhc_mcf_reset, .set_clock = esdhc_mcf_pltfm_set_clock, .get_max_clock = esdhc_mcf_pltfm_get_max_clock, From patchwork Sun Apr 14 07:15:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 788902 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F1CFB224CC; Sun, 14 Apr 2024 07:15:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078938; cv=none; b=KGeYgt0HfU67JMUNwXB7xi5FUxQdxrJ+AzCnG8paGdhf3cTf467lOGZJ+ouNBKFMkiamdjKd8eADvtFYhAAJAI/NgtQsGpHf4jV0iSCMmKy7AzVGK3XAlEE4kJmuv4GTT4wIXII9XewRq0Ebq7pIqy8ygMdpBIhkOnrfUcvifRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078938; c=relaxed/simple; bh=+gq8/HaBFcrh+lOjt/oiQ6thVO5EDI++3a+IpmyHbZs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r1S3dXbcZ3t0Ys4yzJPOq9vg5Xagj5LMDKLzfpu5HzXaRP0h0ZkmK9S0Bo3Md9HxDydUO+zIVgFkrdJZbJKRp+vde2AT/0hpFF2M4oiNhb6rP0cQZupImyFSiKAkbwKcLHfMM6ANa+tJGEZ/7s6y9gpbQS+3NNpNNPiKBVUxpkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oo7aCOyP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oo7aCOyP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05FFAC32781; Sun, 14 Apr 2024 07:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713078937; bh=+gq8/HaBFcrh+lOjt/oiQ6thVO5EDI++3a+IpmyHbZs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Oo7aCOyP84hPcs2MyCNuBa5991sbNIcjbuSd00cBRv+CldmtU4UTYQcwFE2Pk03uz ytYCWZQ9M48xB6E1aFL344MS257zH7UQX0W0fcC67Hz5RKNnQQqVReEg+JrYoNmgI+ 5ZL4hYABdSYsfGug1tu425m+V6bHywq2zKngOUOlrtMN5UpMGfAajN4bzFEcXWsdqU 7VOlh3vvPSOjb7XRDWAc4WuWdJEPOlcdwe4Y3IXioSew9V+S15dJrw/F6ylf3vh/tg hwsogt1Y25ag5UzXPet3X14levyaXa4t5FitjID0vXg44r++uhw5hkHhMCEeYuu6Ky 7S8vzNQ6I2mpQ== From: Krzysztof Kozlowski Date: Sun, 14 Apr 2024 09:15:15 +0200 Subject: [PATCH 2/5] mmc: sdhci-omap: Constify struct sdhci_ops Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240414-mmc-const-sdhci-ops-v1-2-178539d68093@kernel.org> References: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> In-Reply-To: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> To: Adrian Hunter , Angelo Dureghello , Ulf Hansson , Vignesh Raghavendra , Orson Zhai , Baolin Wang , Chunyan Zhang , Ben Dooks , Jaehoon Chung Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=754; i=krzk@kernel.org; h=from:subject:message-id; bh=+gq8/HaBFcrh+lOjt/oiQ6thVO5EDI++3a+IpmyHbZs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmG4KKQcj2jruz3h3KLLPgxt5tSjX239ra1Vpiz i9ul6QRxGuJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZhuCigAKCRDBN2bmhouD 1xQyD/9eWA74r4OD9QYqR/pDNGT43O1bauOKvWi85I261jiYc12BO/VgRi8GEI5f9TguBIXNAH8 7fMizm2pux7RpPGqaXrVMFWNgoNE1giSm24xnduIG2Cdky4Oz8i8MmimR5z434HMgCcbCJfp+Oi 4uGDpUcLuVR48P6OZ9E18TyPDeR3Ppol3/e005RZAEFjvjVZifdBBr3GzQB95akkKQjKvDnE0+B sOEkm01UAnW46q/js2EshuiGo3qSqWT3GWtEwnNTC2mDl073YyqoKchJkgBMiPc8ovJwffS/b/M nCdr4e9RuW8jdh3nHEmUBIHRATDh8m02gu7zxbBgso8ygkWoSXwp2sTkK694rz7uChgfvgq8xCe e23v1+ybfSXgTxJfIt+eRJa6y09rErDBVu4hVgdh+jA/qUBGSOIMtfvfxnn4IM3HcL5aRZC0TG7 ezOKUInVTBB+4c6hjspBPPcLJHdhR0FfL7+cDGh/ml+AY/3rL9NS+xYKskh0iT/B/hW2PCovYKE pRYYgT6WhgT/jdBdTXRcvtuwU9JP0o34jDyHDONvuh4EOZC+vgTXzLB+cr18FmItzotIM/Q+mqj YnTj0I3f/MLnIyWRNw0HqgsJIVlS1tWMH9kb1O/JuwC/JR84pEAkCMShSVRV8jn2ntM0NmJDXef gCT1n1ALqTOmB9A== X-Developer-Key: i=krzk@kernel.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The local struct sdhci_ops can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/mmc/host/sdhci-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 94076b095571..5841a9afeb9f 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -925,7 +925,7 @@ static void sdhci_omap_set_timeout(struct sdhci_host *host, __sdhci_set_timeout(host, cmd); } -static struct sdhci_ops sdhci_omap_ops = { +static const struct sdhci_ops sdhci_omap_ops = { .set_clock = sdhci_omap_set_clock, .set_power = sdhci_omap_set_power, .enable_dma = sdhci_omap_enable_dma, From patchwork Sun Apr 14 07:15:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 789138 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 06B4922F1C; Sun, 14 Apr 2024 07:15:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078941; cv=none; b=SW0jRloE4rzPNC7C2S7q4gHWJBT8PsjOwjmqQ7GdSVUSEyI/4EE8+EEGM0ZqobyINTFRMuJ6C4v20aIUSovzh/qJ9OTpn0DlDJkybjkmD0eWnOJW8UvWlpF4hyhtJLe3Hna9WEkQkZHYp/m2gWMubIsJms5/m2cKQjBGCaIvBGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078941; c=relaxed/simple; bh=6xewGZjyB3FgtC9pR8X505+HKwYWfSCoiugoRhC/E3c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G+AdraFdUW2rR68xQyWJCp2DJZuQ88XElIxHMhjfvIGLWjUjwRCBWbilg6/FBqekI0GtpLZ0T4GnEjnCzDZd0WOsHTTLwimA4hUvRc3LCQ5bviEsZpxomuqD26G5C+sTME5ztExF3YA80+n0XqC8YWs/yQJkCiKLqbXt2FB9YTE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RiZdk+Vq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RiZdk+Vq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 206B1C32783; Sun, 14 Apr 2024 07:15:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713078940; bh=6xewGZjyB3FgtC9pR8X505+HKwYWfSCoiugoRhC/E3c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=RiZdk+VqjlMLeLqQctODOqA64wKRCEc9mbCR/17zAKmdLMdkoJkOyvO+a2KmJ43aH dD9+LXEyC1bqOXLLnlpE8DLVcVNXg/alEedb/lFfGIi+XYzF09hJns4Q/XoG7H6AqD 21849oMeAmRrYUoHlXLZ8ALMRCO2Fb+y4bX1wjTOzHXrgPlYLFS9glms23N22grNnx +qXwclSWCgXEgZ3ZyK1HvUzko+cjv4ArMQSbL80xo2N6YhyTcXOZNz9VceitfTfqDj q7Fv8ZxPoDTm/B3pWtQsV09ksqhcGeuNT39Ubh7G72Fu4yLln+uCVXvJdbcHD2SUlp reCo6ssh48B/w== From: Krzysztof Kozlowski Date: Sun, 14 Apr 2024 09:15:16 +0200 Subject: [PATCH 3/5] mmc: sdhci-sprd: Constify struct sdhci_ops Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240414-mmc-const-sdhci-ops-v1-3-178539d68093@kernel.org> References: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> In-Reply-To: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> To: Adrian Hunter , Angelo Dureghello , Ulf Hansson , Vignesh Raghavendra , Orson Zhai , Baolin Wang , Chunyan Zhang , Ben Dooks , Jaehoon Chung Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=723; i=krzk@kernel.org; h=from:subject:message-id; bh=6xewGZjyB3FgtC9pR8X505+HKwYWfSCoiugoRhC/E3c=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmG4KLqqTzbFGHsPVVDq2DBc6QTf8lMHeWUdHF6 +eH8WCI7fuJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZhuCiwAKCRDBN2bmhouD 11WkD/48GPiWAcr9XYxz4bEQK1AUdVjRLQAHbMgrQJSaKO1ItWrJNES/ihvPi+OOupU82wkrNAI fJYL7bySFpteMVI4gqBWM+7SP6+7SSy9ZCxxxCx9wYR1AojbGo+r1U0fobqFGq4th5gnkoN+Z46 F0pjqKcgCYGJx/Pc+p4aDJhtT7rpTnXa0ZAZUlbvRtraSxbAC11GTPS4lkrf7QWlaJQ4L2gqIv9 WEDf0SNeRjbcgJCR+JoLRWBFJlOHGk7TF1lM3hzuUqRqNjJ29WD9SoUAeTAf39XchcGmpnNlpOO oPaHHTrM7C9zIRJmRCD+0CZjWbUv7GybWnjzMhhH3CCXBNN3SPBmygt05nTWO51hZv+lAbkUIbH +ybaZ1EiaJus+evgMaRclxU+ECPokjaLbesqm/WGWoEZUCs3w2TGGK83Sqwg7+iqVmAlPOGIfPs Fzy3lEbW3N1Q0JGv0t0YGqFxIttnGgXWcdOrE+Z4/cghU2kB+8lu+HPSK75rySxs9GexiL1A4WR USWdTxmlU/4BbSsOreNKK2ow2IuYSng3yFwydjvWrmxrvXdl8G9UgWekjk4M5mUo3CdLcwoAwrU 8lmzDXwFSM8mQqNCy7kzzP+NhWGqxF6NcqDfdCDrZcr3G1nm43thYi2NUUoIj2kYzM3CZ+ZeRag mf9DcI80mTmF4og== X-Developer-Key: i=krzk@kernel.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The local struct sdhci_ops can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/mmc/host/sdhci-sprd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 685b1c648901..8776f4287119 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -439,7 +439,7 @@ static void sdhci_sprd_set_power(struct sdhci_host *host, unsigned char mode, } } -static struct sdhci_ops sdhci_sprd_ops = { +static const struct sdhci_ops sdhci_sprd_ops = { .read_l = sdhci_sprd_readl, .write_l = sdhci_sprd_writel, .write_w = sdhci_sprd_writew, From patchwork Sun Apr 14 07:15:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 788901 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3F0562868D; Sun, 14 Apr 2024 07:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078944; cv=none; b=U2mlrCJzGNDt15KRXg+Ms3+VxfaObAHjEyWZClprrapVmsMAF/eAYvM4qdeKzGKz/DVWrdtKSst+Q7WuOAxi/PgzzhWrRq5WVmk0OFqdHZfPOaNVoBcPdkBbtwM/GO9dMXxXc09jJE9EVw8l81gmhsmvdWyjgxVOZvnPJQZQSRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078944; c=relaxed/simple; bh=uD+ViLOa9S8ut1fdu47zbr3AGnB2izGuU5i0gc4OfAY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dQt1laV5tJElGr9Qir/YUBvCemSv7br+6q9wSy+oAheZay3x/Gtmno7XrR6uIowbu6OskkWCbRsyM6RCbq5zKDwxTd5MS+jyAW6MS6mvsS6LYuBxqYV3DNdnw/8DC5u2dsc+F4x5kAy/saiZcCwJQYyiaBQWlnrZvRBKbPtcsVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L2t74mPG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L2t74mPG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B004C32781; Sun, 14 Apr 2024 07:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713078944; bh=uD+ViLOa9S8ut1fdu47zbr3AGnB2izGuU5i0gc4OfAY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=L2t74mPGBiOvi7SZmrw2Zd5cmuKDERFwSFI94FyJSyPATx/JFsaaiRv8ujBIier5R pMhzFsEl01Qn0yrivjsJ7G8zAAn2BDNoGbRCk7iaMqBBLogcwQhDzpr91mZnOHTlN4 YLneMMiR26xlocl6L8RjetRsVEXfeDxeNXgcViVB0dRGnVc+w8TLyJsijHSBKwp8Vl QgyB+RGty58zZ3iLXGinHOBbzQeHxOP4uqEZHdkEjDAVm/bitGe1rwOQIJLt8OiBU7 p9DtFQVUtYgEJ8CgzhJ4J1CC4iJ0yCkaOyiqI0V/GWFqmCx7mSTEke9Ktzr+vpCcpz YxmuNcgGqisZw== From: Krzysztof Kozlowski Date: Sun, 14 Apr 2024 09:15:17 +0200 Subject: [PATCH 4/5] mmc: sdhci_am654: Constify struct sdhci_ops Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240414-mmc-const-sdhci-ops-v1-4-178539d68093@kernel.org> References: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> In-Reply-To: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> To: Adrian Hunter , Angelo Dureghello , Ulf Hansson , Vignesh Raghavendra , Orson Zhai , Baolin Wang , Chunyan Zhang , Ben Dooks , Jaehoon Chung Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1685; i=krzk@kernel.org; h=from:subject:message-id; bh=uD+ViLOa9S8ut1fdu47zbr3AGnB2izGuU5i0gc4OfAY=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmG4KMj8KzBrNkHRumdl2yl7nMeq2VMN9nMd7Jp VuF8Mpro1KJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZhuCjAAKCRDBN2bmhouD 16AbD/wNDEAPEB0gmb+3xBdMBEtR4LzHruYj/ZsrADoAJ3C9E+UQzK3hHINhq/uJvrzXiMDipM8 hgHI2Og0p81JxX7wBUXc4ffpSIfCQpopMyUn1qJHQZWbZKdyrHMMo6KH/cKf77FA03VWxyX0ZZd //FBBlbSuCb3kJgshzBYtARueKCipvfTMVTT0xHHmRndCJrs9EapdfeIXZH+rPjNhV3qmRX4ut1 eF6CheLsMFYmFpQueWu/jWsjRDRtAdc2fA0HPWVnBuviMfWGzDU2vwuHfjk2oA39Tg2EqnuqOEa dCivszHPLOw45c5swXdbrAhNvvbmTgS2h9rZQ2iyvd1thV2LAM3QQ+TTCJRhHmRNlTIp3YS6lWA enxqz/9jlemDZr84zE4nkUnVXXw4nrBVid8ZthjFGtfblJSbIwLPQMODRT36X3dfgcLzq0JEzUH 2VY2XdQXVySqW3Ed+Gu9ERtZHQS5BQP/5rxk8PE1aB0bLgJltcWDj2m1P0N5ia0TEK2X1XrCnDr inR0VfvMl70Z4ZPt3U4fajyuxGrbzEFe2aQhTEC06qH0nLpSW6hSh9UFqq2iluKTYd6RolrmtvR ZCRDAWAL30w1+75nE2p1cx3m0lExjQ4VtAlSbbDe4A0I/3T0PpXqHkBoGbe63e/B9MR7b2Wa+6V EbPnjpuSgvr4MKw== X-Developer-Key: i=krzk@kernel.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The local struct sdhci_ops can be made const for code safety. Signed-off-by: Krzysztof Kozlowski --- drivers/mmc/host/sdhci_am654.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index ba36123e4ccc..17ad32cfc0c3 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -543,7 +543,7 @@ static int sdhci_am654_platform_execute_tuning(struct sdhci_host *host, return 0; } -static struct sdhci_ops sdhci_am654_ops = { +static const struct sdhci_ops sdhci_am654_ops = { .platform_execute_tuning = sdhci_am654_platform_execute_tuning, .get_max_clock = sdhci_pltfm_clk_get_max_clock, .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, @@ -573,7 +573,7 @@ static const struct sdhci_am654_driver_data sdhci_am654_drvdata = { .flags = IOMUX_PRESENT | FREQSEL_2_BIT | STRBSEL_4_BIT | DLL_PRESENT, }; -static struct sdhci_ops sdhci_j721e_8bit_ops = { +static const struct sdhci_ops sdhci_j721e_8bit_ops = { .platform_execute_tuning = sdhci_am654_platform_execute_tuning, .get_max_clock = sdhci_pltfm_clk_get_max_clock, .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, @@ -597,7 +597,7 @@ static const struct sdhci_am654_driver_data sdhci_j721e_8bit_drvdata = { .flags = DLL_PRESENT | DLL_CALIB, }; -static struct sdhci_ops sdhci_j721e_4bit_ops = { +static const struct sdhci_ops sdhci_j721e_4bit_ops = { .platform_execute_tuning = sdhci_am654_platform_execute_tuning, .get_max_clock = sdhci_pltfm_clk_get_max_clock, .get_timeout_clock = sdhci_pltfm_clk_get_max_clock, From patchwork Sun Apr 14 07:15:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 789137 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E515F2E631; Sun, 14 Apr 2024 07:15:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078948; cv=none; b=jt83FRdOF+BOtPwe3klp02KvZsREEQlu0vhe/zyltsXKnB/sedirEkTIOs0BVWEThXPa7kZu1v+IZIXmb2tcmHKKaNkn5rXin0fygW2xCQUHuTuRV7wPwWqWaqCKyJ2WIW0xE42zcYIM1SFmOhhNebP9Wkq12WwcqKTAPwGZ5QQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713078948; c=relaxed/simple; bh=8d/9E0pz4G5hy6Wtr2AcynVmnL8LOYC286o2KeCuhKY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YeMfKDIZuHx56ZGtFGXoH5XXHIfRfU67140rn0DlmbErlQNluEmVB0m4cX9+8v62ABUySzkmBM0NWQGTBluJCmL6/kXPC4zGQPwMtqRizBfTXcTs0Wpqm2xWR/haFxKrSLYL9j4OZNWj6H3daisURFdGI8GLrZO4D6WjKp0UaPc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fgBfhiVg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fgBfhiVg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82739C32783; Sun, 14 Apr 2024 07:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713078947; bh=8d/9E0pz4G5hy6Wtr2AcynVmnL8LOYC286o2KeCuhKY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fgBfhiVgYW8n3JEijNDA2fJGkn2ISoHMYTRrXFk7wnJBgG17uvTPJYmy96yK4zxFk jV3VDGtlbsU2jtekrdZMtbnHKyFob7JcZ4fYcAt+N4+l1NVmPGdjVdFJQPayiugrKI ulAy7OdbsBMJORs95/8pU+zg+gHqhBUWX1ulIYikWRlnVCF+hkwC6nWulyB7FZF6YI m9KeMr6mN6925yt7HVepjj4X9cMvJAxvQ8dEtKYxbOFeOSFp2Oyn/Weah/vOIBZc/D U3rB3cuGGM5ckwPSoQP2FEZ22IgqMF2XFvaUjt7U+F7I/QKXRULXVIkJvJvzgCbssv f9PdgtXYzv4Cw== From: Krzysztof Kozlowski Date: Sun, 14 Apr 2024 09:15:18 +0200 Subject: [PATCH 5/5] mmc: sdhci-s3c: Choose sdhci_ops based on variant Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240414-mmc-const-sdhci-ops-v1-5-178539d68093@kernel.org> References: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> In-Reply-To: <20240414-mmc-const-sdhci-ops-v1-0-178539d68093@kernel.org> To: Adrian Hunter , Angelo Dureghello , Ulf Hansson , Vignesh Raghavendra , Orson Zhai , Baolin Wang , Chunyan Zhang , Ben Dooks , Jaehoon Chung Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3953; i=krzk@kernel.org; h=from:subject:message-id; bh=8d/9E0pz4G5hy6Wtr2AcynVmnL8LOYC286o2KeCuhKY=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmG4KNEGtWvruYUf6SGR3nHCDUWZtm4j412LE5/ F82twc6hv6JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZhuCjQAKCRDBN2bmhouD 15rBEACGeEZsNqJuS09TnNJYJhcEqxUZYiX4Wr/cSuVS+EYl/fcHj1UgFB0XzsHq7WiiWX9yafm CcMHEeNArIde/TftaknbmfZnxYfgczu+108mHMD184WNvBEjBZ3a4WnrodXSintAcffjElTMeTH usMLT8tjC1xwCW90LoKnYeEPAlteDRImMlr+yVDeLWdpjT/BIld34gyT7HXcGM7MpZFw3i/Bs2p Zoe1EjXUwGrv0adBiv2BVzRe3c4xV4dFA8MsMXa+vvsU1u5XUpSeOAlcNoQ++Yb6NLOneh0W7Y7 ZREbTKaWsGADx9W8rjlTKUE7N47V0je810fGMsGz8AA9ix3hK2Of2zq9q2Fwji1jnMvzKVHXAtY Vmj7d7g4tLMYzGyO4RfwvDFu/5s4lBBkMJkVG7640C63wQWdZW7B8ZCNSxhpMFre3XLIqpHCEXF 0N1derA/ocC08dG5/VyYLwrlVFO4YPZGS+aKLEOwL4jFvJ/cwJtCgxMCKaLL3mRigSBt07RRY2q p0kSnN3vC8c5St6zjlrIpvE0MWHJx0vQ5Ds9pX0BtDwmPOataWBlS/h+am9KLGaAO9rmTLgVNoj ua4SL6RS4UGAn22x3vgceQQe49c85ySrpSZ68aKLEesj2DabNcov8b8FuUYTiGbfRiIcjO6A9TY Sp2q/NAGXxe2aTw== X-Developer-Key: i=krzk@kernel.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The difference between old S3C64xx and newer Exynos4 SDHCI controller variants is in clock handling (the "no_divider" field in drvdata). Choose the proper sdhci_ops based on the variant instead of patching ops in probe, if Exynos4 is used. This allows making struct sdhci_ops const for code safety and probably opens further options in the future, as the dynamic pointer ops table is not anymore that dynamic. Signed-off-by: Krzysztof Kozlowski --- drivers/mmc/host/sdhci-s3c.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 6493b0edba34..6c2a42c1819a 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -130,14 +130,16 @@ struct sdhci_s3c { * struct sdhci_s3c_drv_data - S3C SDHCI platform specific driver data * @sdhci_quirks: sdhci host specific quirks. * @no_divider: no or non-standard internal clock divider. + * @ops: sdhci_ops to use for this variant * * Specifies platform specific configuration of sdhci controller. * Note: A structure for driver specific platform data is used for future * expansion of its usage. */ struct sdhci_s3c_drv_data { - unsigned int sdhci_quirks; - bool no_divider; + unsigned int sdhci_quirks; + bool no_divider; + const struct sdhci_ops *ops; }; static inline struct sdhci_s3c *to_s3c(struct sdhci_host *host) @@ -412,7 +414,7 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); } -static struct sdhci_ops sdhci_s3c_ops = { +static const struct sdhci_ops sdhci_s3c_ops_s3c6410 = { .get_max_clock = sdhci_s3c_get_max_clk, .set_clock = sdhci_s3c_set_clock, .get_min_clock = sdhci_s3c_get_min_clock, @@ -421,6 +423,15 @@ static struct sdhci_ops sdhci_s3c_ops = { .set_uhs_signaling = sdhci_set_uhs_signaling, }; +static const struct sdhci_ops sdhci_s3c_ops_exynos4 = { + .get_max_clock = sdhci_cmu_get_max_clock, + .set_clock = sdhci_cmu_set_clock, + .get_min_clock = sdhci_cmu_get_min_clock, + .set_bus_width = sdhci_set_bus_width, + .reset = sdhci_reset, + .set_uhs_signaling = sdhci_set_uhs_signaling, +}; + #ifdef CONFIG_OF static int sdhci_s3c_parse_dt(struct device *dev, struct sdhci_host *host, struct s3c_sdhci_platdata *pdata) @@ -560,7 +571,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev) pdata->cfg_gpio(pdev, pdata->max_width); host->hw_name = "samsung-hsmmc"; - host->ops = &sdhci_s3c_ops; + host->ops = &sdhci_s3c_ops_s3c6410; host->quirks = 0; host->quirks2 = 0; host->irq = irq; @@ -570,6 +581,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev) host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT; if (drv_data) { host->quirks |= drv_data->sdhci_quirks; + host->ops = drv_data->ops; sc->no_divider = drv_data->no_divider; } @@ -617,16 +629,6 @@ static int sdhci_s3c_probe(struct platform_device *pdev) /* HSMMC on Samsung SoCs uses SDCLK as timeout clock */ host->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; - /* - * If controller does not have internal clock divider, - * we can use overriding functions instead of default. - */ - if (sc->no_divider) { - sdhci_s3c_ops.set_clock = sdhci_cmu_set_clock; - sdhci_s3c_ops.get_min_clock = sdhci_cmu_get_min_clock; - sdhci_s3c_ops.get_max_clock = sdhci_cmu_get_max_clock; - } - /* It supports additional host capabilities if needed */ if (pdata->host_caps) host->mmc->caps |= pdata->host_caps; @@ -758,6 +760,7 @@ MODULE_DEVICE_TABLE(platform, sdhci_s3c_driver_ids); #ifdef CONFIG_OF static const struct sdhci_s3c_drv_data exynos4_sdhci_drv_data = { .no_divider = true, + .ops = &sdhci_s3c_ops_exynos4, }; static const struct of_device_id sdhci_s3c_dt_match[] = {