From: Smitha T Murthy <smitha.t@samsung.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Andrzej Hajda <a.hajda@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Inki Dae <inki.dae@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>
Subject: Re: [v2, 02/15] media: s5p-mfc: Use generic of_device_get_match_data helper
Date: Fri, 03 Mar 2017 19:21:46 +0530 [thread overview]
Message-ID: <1488549106.3182.17.camel@smitha-fedora> (raw)
In-Reply-To: <1487597944-2000-3-git-send-email-m.szyprowski@samsung.com>
On Mon, 2017-02-20 at 14:38 +0100, Marek Szyprowski wrote:
> Replace custom code with generic helper to retrieve driver data.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Smitha T Murthy <smitha.t@samsung.com>
Regards,
Smitha T Murthy
> ---
> drivers/media/platform/s5p-mfc/s5p_mfc.c | 17 ++---------------
> drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 4 ++--
> 2 files changed, 4 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index 3e1f22eb4339..ad3d7377f40d 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -22,6 +22,7 @@
> #include <media/v4l2-event.h>
> #include <linux/workqueue.h>
> #include <linux/of.h>
> +#include <linux/of_device.h>
> #include <linux/of_reserved_mem.h>
> #include <media/videobuf2-v4l2.h>
> #include "s5p_mfc_common.h"
> @@ -1157,8 +1158,6 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev)
> device_unregister(mfc_dev->mem_dev_r);
> }
>
> -static void *mfc_get_drv_data(struct platform_device *pdev);
> -
> /* MFC probe function */
> static int s5p_mfc_probe(struct platform_device *pdev)
> {
> @@ -1182,7 +1181,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> - dev->variant = mfc_get_drv_data(pdev);
> + dev->variant = of_device_get_match_data(&pdev->dev);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
> @@ -1541,18 +1540,6 @@ static int s5p_mfc_resume(struct device *dev)
> };
> MODULE_DEVICE_TABLE(of, exynos_mfc_match);
>
> -static void *mfc_get_drv_data(struct platform_device *pdev)
> -{
> - struct s5p_mfc_variant *driver_data = NULL;
> - const struct of_device_id *match;
> -
> - match = of_match_node(exynos_mfc_match, pdev->dev.of_node);
> - if (match)
> - driver_data = (struct s5p_mfc_variant *)match->data;
> -
> - return driver_data;
> -}
> -
> static struct platform_driver s5p_mfc_driver = {
> .probe = s5p_mfc_probe,
> .remove = s5p_mfc_remove,
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> index 3e0e8eaf8bfe..2f1387a4c386 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
> @@ -192,7 +192,7 @@ struct s5p_mfc_buf {
> */
> struct s5p_mfc_pm {
> struct clk *clock_gate;
> - const char **clk_names;
> + const char * const *clk_names;
> struct clk *clocks[MFC_MAX_CLOCKS];
> int num_clocks;
> bool use_clock_gating;
> @@ -304,7 +304,7 @@ struct s5p_mfc_dev {
> struct v4l2_ctrl_handler dec_ctrl_handler;
> struct v4l2_ctrl_handler enc_ctrl_handler;
> struct s5p_mfc_pm pm;
> - struct s5p_mfc_variant *variant;
> + const struct s5p_mfc_variant *variant;
> int num_inst;
> spinlock_t irqlock; /* lock when operating on context */
> spinlock_t condlock; /* lock when changing/checking if a context is
next prev parent reply other threads:[~2017-03-03 15:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170220133910eucas1p10f347d7688dd51ea70d15994c9d5d1f1@eucas1p1.samsung.com>
2017-02-20 13:38 ` [PATCH v2 00/15] Exynos MFC v6+ - remove the need for the reserved memory Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 01/15] media: s5p-mfc: Remove unused structures and dead code Marek Szyprowski
2017-02-21 11:11 ` Andrzej Hajda
2017-03-03 9:24 ` [v2,01/15] " Smitha T Murthy
2017-03-03 11:56 ` Smitha T Murthy
2017-02-20 13:38 ` [PATCH v2 02/15] media: s5p-mfc: Use generic of_device_get_match_data helper Marek Szyprowski
2017-03-03 13:51 ` Smitha T Murthy [this message]
2017-02-20 13:38 ` [PATCH v2 03/15] media: s5p-mfc: Replace mem_dev_* entries with an array Marek Szyprowski
2017-02-22 16:22 ` Shuah Khan
2017-03-17 11:29 ` Sylwester Nawrocki
2017-02-20 13:38 ` [PATCH v2 04/15] media: s5p-mfc: Replace bank1/bank2 " Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 05/15] media: s5p-mfc: Simplify alloc/release private buffer functions Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 06/15] media: s5p-mfc: Move setting DMA max segment size to DMA configure function Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 07/15] media: s5p-mfc: Put firmware to private buffer structure Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 08/15] media: s5p-mfc: Move firmware allocation to DMA configure function Marek Szyprowski
2017-02-20 13:49 ` Javier Martinez Canillas
2017-02-22 18:07 ` Shuah Khan
2017-02-23 7:30 ` Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 09/15] media: s5p-mfc: Allocate firmware with internal private buffer alloc function Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 10/15] media: s5p-mfc: Reduce firmware buffer size for MFC v6+ variants Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 11/15] media: s5p-mfc: Split variant DMA memory configuration into separate functions Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 12/15] media: s5p-mfc: Add support for probe-time preallocated block based allocator Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 13/15] media: s5p-mfc: Remove special configuration of IOMMU domain Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 14/15] media: s5p-mfc: Use preallocated block allocator always for MFC v6+ Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 15/15] ARM: dts: exynos: Remove MFC reserved buffers Marek Szyprowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488549106.3182.17.camel@smitha-fedora \
--to=smitha.t@samsung.com \
--cc=a.hajda@samsung.com \
--cc=inki.dae@samsung.com \
--cc=krzk@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=s.nawrocki@samsung.com \
--cc=sw0312.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox