diff mbox series

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

Message ID 20230312131318.351173-20-krzysztof.kozlowski@linaro.org
State New
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
Arnd Bergmann March 21, 2023, 8:24 a.m. UTC | #2
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
Sakari Ailus May 25, 2023, 1:16 p.m. UTC | #3
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:
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,
 	},
 };