Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp918000pxu; Wed, 2 Dec 2020 06:43:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWjMclD0Av5l/hSt2RRa75U7kEd2vHwjSL4OgvylY8gDikCN8lUms6byIQofclmtdkomge X-Received: by 2002:a17:906:7c45:: with SMTP id g5mr92392ejp.502.1606920200537; Wed, 02 Dec 2020 06:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606920200; cv=none; d=google.com; s=arc-20160816; b=OOrKNQTZAe6jCFXxckPOwHjFE8XHyfhZ+iJIiqo0PvN0eMQKi4N8AGNuB5Wng53bGc ne5RaUAq50nsTYepDMfvU49U7swQIcgdo6gHtAva7UwD+t/mjX/FgMeRUhFxAqxMgLmh 37HcnypaEkBC6Ak6GWCZ2y0F0nJktmLmZhPZgwPIOegaZYVvggbdOCQINrc6CYx5vpm6 Hy+FZH0iYGe8all49/nIjGVC6p0V3rPHVSn2uA5fg9RB1UTIiNG1hx0CAhYHobkrQ8QE 2l7JwbDmCa4HKMXYokedZjIdYwfUM2bPeDuPg1VZiowdhAZnlPcG/YyJpWOw3nhjTbIr XiGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2ZFn9jj7ck1AeGmEuUzHYIIlYUJOzST9lxK0bajNvuY=; b=wENxCfCqXFQbHrojGK4HRcOy32pfeR9h9YWqjLcIhglocvkHTOWX/yfaKXHFiacoLI /m9HBbO29EwLRkh5VstySB8YvqiR84Jz4CfAWnDHyPXAiJUyF0INaY2U3V/Ulkfv/gQG lQzwM98HFFn4WO0HxX+aPafwSibkvY6odwIYGpfzafj1/CyfizAin3jPOtAwF03DN0+e 4ETvoLASgKoofgypNqZuy5uVqGr2ofC75uiawa7vEpcTzH/d6DTWszZ5vAP7FjiQvcwG EQBrfIp0voQAuFCWgMkttDJ9Zjp6sqjIsfoyCD6bj2s8H5NOjf31AhazdPz8rKIKhQur n15w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cNQC3QRX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si82004ejd.204.2020.12.02.06.42.56; Wed, 02 Dec 2020 06:43:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cNQC3QRX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388668AbgLBOiz (ORCPT + 99 others); Wed, 2 Dec 2020 09:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbgLBOiy (ORCPT ); Wed, 2 Dec 2020 09:38:54 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49F6AC0613CF; Wed, 2 Dec 2020 06:38:08 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id t7so881776pfh.7; Wed, 02 Dec 2020 06:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2ZFn9jj7ck1AeGmEuUzHYIIlYUJOzST9lxK0bajNvuY=; b=cNQC3QRXG4RXBAA9H4ChKE2dtSOwnaaxBVEnhqkKUT7ycCK0dRpA38X9gid4c7Sif2 yQhPPBDur/QK+vH5gpBEfXLoIqrw2W8wC0lqnJcorbO4AEjNxtwsPl3TLTZ4c8poar5n Yxx+/tjJSgnQvjTQb5KQo4VAjPFMgJOcAqi7Buq7rlfz5nCBKppZR5+lpHyqkuI/Wcef 6Za2Ck5N7j5Uz+uQBPTeM0AwrMKlSY7jB5JmhM9CUzqWQMmBG8lniwf+L15gR1WlY7vX rjDC/jDq5oGsKh+EjwXY1ztViDySUbBxfqubgzobKPiv1XXALIU2yDDknSLJuGsy4nbN TxPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2ZFn9jj7ck1AeGmEuUzHYIIlYUJOzST9lxK0bajNvuY=; b=johpKokK4va5yeowCwmEtFbY8BtTKBQ40OIjNhcETgPxak8EqSpvdEAEep5gACAjRC MUuQTkvQJ0vkRhd271YvDV8ynouWoKluat44Z/ubR1vTiq5qkch/3urD6nEMDZ9aUnfj 6zC2gwvwehesZODc5W4ZvHkpsPiidOVwxWINgzlLk/vP8Gk6n7TwtV1Ul/hlvqI1PZAq ipQTAJWEQ+FtlCDL4mPfHhVCPP9shM20Q/V03QD6ARMfirSEmz+4tdzwL91IO66n7Rdo gzXbSFSY8ps7p5cqSZhcktkHoeyNe6RA+Om9usoSVv8s/o775rSuIImnnEp42QKUYHNp cJAQ== X-Gm-Message-State: AOAM530SAbhLrgux/9kHGIi/jna1nV8NZCaXDo7178wJFNLduymbne/s HLCpsEk7E4+RR5w6PG3DvmL60DziIUp9E8OgBME= X-Received: by 2002:a62:445:0:b029:19c:162b:bbef with SMTP id 66-20020a6204450000b029019c162bbbefmr2940391pfe.40.1606919887806; Wed, 02 Dec 2020 06:38:07 -0800 (PST) MIME-Version: 1.0 References: <20201202141326.32645-1-festevam@gmail.com> In-Reply-To: <20201202141326.32645-1-festevam@gmail.com> From: Andy Shevchenko Date: Wed, 2 Dec 2020 16:38:56 +0200 Message-ID: Subject: Re: [PATCH v4] media: coda: Convert the driver to DT-only To: Fabio Estevam Cc: Philipp Zabel , Mauro Carvalho Chehab , Linux Media Mailing List , Hans Verkuil , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 2, 2020 at 4:15 PM Fabio Estevam wrote: > > Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code > by removing the unused non-DT support. I haven't checked full context but from what I see the patch looks good to me, FWIW, Reviewed-by: Andy Shevchenko > > Signed-off-by: Fabio Estevam > --- > Changes since v3: > - Add a explicit OF dependency - Andy > > drivers/media/platform/Kconfig | 2 +- > drivers/media/platform/coda/coda-common.c | 27 ++--------------------- > include/linux/platform_data/media/coda.h | 14 ------------ > 3 files changed, 3 insertions(+), 40 deletions(-) > delete mode 100644 include/linux/platform_data/media/coda.h > > diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig > index ffffef2267f4..9fdbfea06087 100644 > --- a/drivers/media/platform/Kconfig > +++ b/drivers/media/platform/Kconfig > @@ -201,7 +201,7 @@ if V4L_MEM2MEM_DRIVERS > > config VIDEO_CODA > tristate "Chips&Media Coda multi-standard codec IP" > - depends on VIDEO_DEV && VIDEO_V4L2 && (ARCH_MXC || COMPILE_TEST) > + depends on VIDEO_DEV && VIDEO_V4L2 && OF && (ARCH_MXC || COMPILE_TEST) > select SRAM > select VIDEOBUF2_DMA_CONTIG > select VIDEOBUF2_VMALLOC > diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c > index d30eafea701d..995e95272e51 100644 > --- a/drivers/media/platform/coda/coda-common.c > +++ b/drivers/media/platform/coda/coda-common.c > @@ -25,7 +25,6 @@ > #include > #include > #include > -#include > #include > #include > > @@ -3102,13 +3101,6 @@ static const struct coda_devtype coda_devdata[] = { > }, > }; > > -static const struct platform_device_id coda_platform_ids[] = { > - { .name = "coda-imx27", .driver_data = CODA_IMX27 }, > - { /* sentinel */ } > -}; > -MODULE_DEVICE_TABLE(platform, coda_platform_ids); > - > -#ifdef CONFIG_OF > static const struct of_device_id coda_dt_ids[] = { > { .compatible = "fsl,imx27-vpu", .data = &coda_devdata[CODA_IMX27] }, > { .compatible = "fsl,imx51-vpu", .data = &coda_devdata[CODA_IMX51] }, > @@ -3118,14 +3110,9 @@ static const struct of_device_id coda_dt_ids[] = { > { /* sentinel */ } > }; > MODULE_DEVICE_TABLE(of, coda_dt_ids); > -#endif > > static int coda_probe(struct platform_device *pdev) > { > - const struct of_device_id *of_id = > - of_match_device(of_match_ptr(coda_dt_ids), &pdev->dev); > - const struct platform_device_id *pdev_id; > - struct coda_platform_data *pdata = pdev->dev.platform_data; > struct device_node *np = pdev->dev.of_node; > struct gen_pool *pool; > struct coda_dev *dev; > @@ -3135,14 +3122,7 @@ static int coda_probe(struct platform_device *pdev) > if (!dev) > return -ENOMEM; > > - pdev_id = of_id ? of_id->data : platform_get_device_id(pdev); > - > - if (of_id) > - dev->devtype = of_id->data; > - else if (pdev_id) > - dev->devtype = &coda_devdata[pdev_id->driver_data]; > - else > - return -EINVAL; > + dev->devtype = of_device_get_match_data(&pdev->dev); > > dev->dev = &pdev->dev; > dev->clk_per = devm_clk_get(&pdev->dev, "per"); > @@ -3200,10 +3180,8 @@ static int coda_probe(struct platform_device *pdev) > return ret; > } > > - /* Get IRAM pool from device tree or platform data */ > + /* Get IRAM pool from device tree */ > pool = of_gen_pool_get(np, "iram", 0); > - if (!pool && pdata) > - pool = gen_pool_get(pdata->iram_dev, NULL); > if (!pool) { > dev_err(&pdev->dev, "iram pool not available\n"); > return -ENOMEM; > @@ -3342,7 +3320,6 @@ static struct platform_driver coda_driver = { > .of_match_table = of_match_ptr(coda_dt_ids), > .pm = &coda_pm_ops, > }, > - .id_table = coda_platform_ids, > }; > > module_platform_driver(coda_driver); > diff --git a/include/linux/platform_data/media/coda.h b/include/linux/platform_data/media/coda.h > deleted file mode 100644 > index 293b61b60c9d..000000000000 > --- a/include/linux/platform_data/media/coda.h > +++ /dev/null > @@ -1,14 +0,0 @@ > -/* SPDX-License-Identifier: GPL-2.0-or-later */ > -/* > - * Copyright (C) 2013 Philipp Zabel, Pengutronix > - */ > -#ifndef PLATFORM_CODA_H > -#define PLATFORM_CODA_H > - > -struct device; > - > -struct coda_platform_data { > - struct device *iram_dev; > -}; > - > -#endif > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko