mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] adp1653: check platform_data before usage
@ 2011-07-25 14:16 Andy Shevchenko
  2011-07-26 11:28 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2011-07-25 14:16 UTC (permalink / raw)
  To: linux-media, linux-kernel
  Cc: Andy Shevchenko, Mauro Carvalho Chehab, Sakari Ailus

The driver requires platform_data to be present. That's why we need to check
and fail in case of the absence of necessary data.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
---
 drivers/media/video/adp1653.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
index be7befd..8ad89ff 100644
--- a/drivers/media/video/adp1653.c
+++ b/drivers/media/video/adp1653.c
@@ -413,6 +413,10 @@ static int adp1653_probe(struct i2c_client *client,
 	struct adp1653_flash *flash;
 	int ret;
 
+	/* we couldn't work without platform data */
+	if (client->dev.platform_data == NULL)
+		return -ENODEV;
+
 	flash = kzalloc(sizeof(*flash), GFP_KERNEL);
 	if (flash == NULL)
 		return -ENOMEM;
-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] adp1653: check platform_data before usage
  2011-07-25 14:16 [PATCH] adp1653: check platform_data before usage Andy Shevchenko
@ 2011-07-26 11:28 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2011-07-26 11:28 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-media, linux-kernel, Mauro Carvalho Chehab

Hi, Andy!

On Mon, Jul 25, 2011 at 05:16:41PM +0300, Andy Shevchenko wrote:
> The driver requires platform_data to be present. That's why we need to check
> and fail in case of the absence of necessary data.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
> Cc: Sakari Ailus <sakari.ailus@iki.fi>
> ---
>  drivers/media/video/adp1653.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)

Thanks for the patch. I'll add this to my next pull req.

> 
> diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c
> index be7befd..8ad89ff 100644
> --- a/drivers/media/video/adp1653.c
> +++ b/drivers/media/video/adp1653.c
> @@ -413,6 +413,10 @@ static int adp1653_probe(struct i2c_client *client,
>  	struct adp1653_flash *flash;
>  	int ret;
>  
> +	/* we couldn't work without platform data */
> +	if (client->dev.platform_data == NULL)
> +		return -ENODEV;
> +
>  	flash = kzalloc(sizeof(*flash), GFP_KERNEL);
>  	if (flash == NULL)
>  		return -ENOMEM;
> -- 
> 1.7.5.4
> 

-- 
Sakari Ailus
sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-26 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-25 14:16 [PATCH] adp1653: check platform_data before usage Andy Shevchenko
2011-07-26 11:28 ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®