diff mbox series

[20/28] media: platform: jpeg: always reference OF data

Message ID 20230312131318.351173-20-krzysztof.kozlowski@linaro.org (mailing list archive)
State New, archived
Headers show
Series [01/28] media: cec: ch7322: drop of_match_ptr for ID table | expand

Commit Message

Krzysztof Kozlowski March 12, 2023, 1:13 p.m. UTC
The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1890:38: error: ‘mtk8195_jpegdec_drvdata’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Arnd Bergmann March 21, 2023, 8:11 a.m. UTC | #1
On Sun, Mar 12, 2023, at 14:13, Krzysztof Kozlowski wrote:
> The driver can match only via the DT table so the table should be always
> used and the of_match_ptr does not have any sense (this also allows ACPI
> matching via PRP0001, even though it might not be relevant here).  This
> also fixes !CONFIG_OF error:
>
>   drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1890:38: error: 
> ‘mtk8195_jpegdec_drvdata’ defined but not used 
> [-Werror=unused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

I see now that we both submitted the same patch, but now Hans
merged a worse fix [1] without a changelog text.

    Arnd

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=4ae47770d57bff01
Krzysztof Kozlowski March 21, 2023, 8:21 a.m. UTC | #2
On 21/03/2023 09:11, Arnd Bergmann wrote:
> On Sun, Mar 12, 2023, at 14:13, Krzysztof Kozlowski wrote:
>> The driver can match only via the DT table so the table should be always
>> used and the of_match_ptr does not have any sense (this also allows ACPI
>> matching via PRP0001, even though it might not be relevant here).  This
>> also fixes !CONFIG_OF error:
>>
>>   drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1890:38: error: 
>> ‘mtk8195_jpegdec_drvdata’ defined but not used 
>> [-Werror=unused-const-variable=]
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> I see now that we both submitted the same patch, but now Hans

We as you and me? I cannot find your patch on lore:
https://lore.kernel.org/all/?q=f%3Aarnd%40arndb.de

> merged a worse fix [1] without a changelog text.
> 
>     Arnd
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=4ae47770d57bff01

Uh, I can rebase my patchset.

Best regards,
Krzysztof
Arnd Bergmann March 21, 2023, 8:24 a.m. UTC | #3
On Tue, Mar 21, 2023, at 09:21, Krzysztof Kozlowski wrote:
> On 21/03/2023 09:11, Arnd Bergmann wrote:
>> On Sun, Mar 12, 2023, at 14:13, Krzysztof Kozlowski wrote:
>>> The driver can match only via the DT table so the table should be always
>>> used and the of_match_ptr does not have any sense (this also allows ACPI
>>> matching via PRP0001, even though it might not be relevant here).  This
>>> also fixes !CONFIG_OF error:
>>>
>>>   drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1890:38: error: 
>>> ‘mtk8195_jpegdec_drvdata’ defined but not used 
>>> [-Werror=unused-const-variable=]
>>>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> 
>> I see now that we both submitted the same patch, but now Hans
>
> We as you and me? I cannot find your patch on lore:
> https://lore.kernel.org/all/?q=f%3Aarnd%40arndb.de

This is the one that I sent back in January:

https://lore.kernel.org/all/20230117172644.3044265-1-arnd@kernel.org

      Arnd
Krzysztof Kozlowski March 21, 2023, 8:26 a.m. UTC | #4
On 21/03/2023 09:24, Arnd Bergmann wrote:
> On Tue, Mar 21, 2023, at 09:21, Krzysztof Kozlowski wrote:
>> On 21/03/2023 09:11, Arnd Bergmann wrote:
>>> On Sun, Mar 12, 2023, at 14:13, Krzysztof Kozlowski wrote:
>>>> The driver can match only via the DT table so the table should be always
>>>> used and the of_match_ptr does not have any sense (this also allows ACPI
>>>> matching via PRP0001, even though it might not be relevant here).  This
>>>> also fixes !CONFIG_OF error:
>>>>
>>>>   drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1890:38: error: 
>>>> ‘mtk8195_jpegdec_drvdata’ defined but not used 
>>>> [-Werror=unused-const-variable=]
>>>>
>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>
>>> I see now that we both submitted the same patch, but now Hans
>>
>> We as you and me? I cannot find your patch on lore:
>> https://lore.kernel.org/all/?q=f%3Aarnd%40arndb.de
> 
> This is the one that I sent back in January:
> 
> https://lore.kernel.org/all/20230117172644.3044265-1-arnd@kernel.org

Uh, that's from January! It's still waiting in Patchwork:
https://patchwork.linuxtv.org/project/linux-media/patch/20230117172644.3044265-1-arnd@kernel.org/


Best regards,
Krzysztof
Sakari Ailus May 25, 2023, 1:16 p.m. UTC | #5
On Tue, Mar 21, 2023 at 09:26:29AM +0100, Krzysztof Kozlowski wrote:
> On 21/03/2023 09:24, Arnd Bergmann wrote:
> > On Tue, Mar 21, 2023, at 09:21, Krzysztof Kozlowski wrote:
> >> On 21/03/2023 09:11, Arnd Bergmann wrote:
> >>> On Sun, Mar 12, 2023, at 14:13, Krzysztof Kozlowski wrote:
> >>>> The driver can match only via the DT table so the table should be always
> >>>> used and the of_match_ptr does not have any sense (this also allows ACPI
> >>>> matching via PRP0001, even though it might not be relevant here).  This
> >>>> also fixes !CONFIG_OF error:
> >>>>
> >>>>   drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1890:38: error: 
> >>>> ‘mtk8195_jpegdec_drvdata’ defined but not used 
> >>>> [-Werror=unused-const-variable=]
> >>>>
> >>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>
> >>> I see now that we both submitted the same patch, but now Hans
> >>
> >> We as you and me? I cannot find your patch on lore:
> >> https://lore.kernel.org/all/?q=f%3Aarnd%40arndb.de
> > 
> > This is the one that I sent back in January:
> > 
> > https://lore.kernel.org/all/20230117172644.3044265-1-arnd@kernel.org
> 
> Uh, that's from January! It's still waiting in Patchwork:
> https://patchwork.linuxtv.org/project/linux-media/patch/20230117172644.3044265-1-arnd@kernel.org/

Yes... this still makes sense, to remove of_match_ptr(). I rebased this,
resulting in:

From 230cfaabcd2d5a5f0bc74e113fe84f95028bcdc5 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date: Sun, 12 Mar 2023 14:13:10 +0100
Subject: [PATCH v2 20/28] media: platform: jpeg: always reference OF data

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[Sakari Ailus: Rebased on media tree master, reword commit message.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index 0051f372a66cf..8bcbaa9658bac 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1866,7 +1866,6 @@ static const struct dev_pm_ops mtk_jpeg_pm_ops = {
 	SET_RUNTIME_PM_OPS(mtk_jpeg_pm_suspend, mtk_jpeg_pm_resume, NULL)
 };
 
-#if defined(CONFIG_OF)
 static const struct mtk_jpeg_variant mt8173_jpeg_drvdata = {
 	.clks = mt8173_jpeg_dec_clocks,
 	.num_clks = ARRAY_SIZE(mt8173_jpeg_dec_clocks),
@@ -1949,14 +1948,13 @@ static const struct of_device_id mtk_jpeg_match[] = {
 };
 
 MODULE_DEVICE_TABLE(of, mtk_jpeg_match);
-#endif
 
 static struct platform_driver mtk_jpeg_driver = {
 	.probe = mtk_jpeg_probe,
 	.remove_new = mtk_jpeg_remove,
 	.driver = {
 		.name           = MTK_JPEG_NAME,
-		.of_match_table = of_match_ptr(mtk_jpeg_match),
+		.of_match_table = mtk_jpeg_match,
 		.pm             = &mtk_jpeg_pm_ops,
 	},
 };
diff mbox series

Patch

diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index 969516a940ba..bd12e73492e5 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1898,7 +1898,6 @@  static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
 	.cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M,
 };
 
-#if defined(CONFIG_OF)
 static const struct of_device_id mtk_jpeg_match[] = {
 	{
 		.compatible = "mediatek,mt8173-jpgdec",
@@ -1924,14 +1923,13 @@  static const struct of_device_id mtk_jpeg_match[] = {
 };
 
 MODULE_DEVICE_TABLE(of, mtk_jpeg_match);
-#endif
 
 static struct platform_driver mtk_jpeg_driver = {
 	.probe = mtk_jpeg_probe,
 	.remove = mtk_jpeg_remove,
 	.driver = {
 		.name           = MTK_JPEG_NAME,
-		.of_match_table = of_match_ptr(mtk_jpeg_match),
+		.of_match_table = mtk_jpeg_match,
 		.pm             = &mtk_jpeg_pm_ops,
 	},
 };