All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  driver: rtc: tps65910: Add parameter check
@ 2017-03-15 10:52 ` Daniel Schultz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Schultz @ 2017-03-15 10:52 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni, rtc-linux, linux-kernel

If the tps65910 driver has no interrupt, the probe of tps65910-rtc will
fail.

This patch adds a check in the probe of the rtc if an interrupt exist.
The check is similar to the check in the function which creates the
interrupt.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
 drivers/rtc/rtc-tps65910.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index d0244d7..8c5ca11 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -375,6 +375,11 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
 
 	tps65910 = dev_get_drvdata(pdev->dev.parent);
 
+	if (!tps65910->chip_irq) {
+		dev_warn(&pdev->dev, "No interrupt support, not created\n");
+		return -EINVAL;
+	}
+
 	tps_rtc = devm_kzalloc(&pdev->dev, sizeof(struct tps65910_rtc),
 			GFP_KERNEL);
 	if (!tps_rtc)
-- 
1.9.1

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

* [rtc-linux] [PATCH]  driver: rtc: tps65910: Add parameter check
@ 2017-03-15 10:52 ` Daniel Schultz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Schultz @ 2017-03-15 10:52 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni, rtc-linux, linux-kernel

If the tps65910 driver has no interrupt, the probe of tps65910-rtc will
fail.

This patch adds a check in the probe of the rtc if an interrupt exist.
The check is similar to the check in the function which creates the
interrupt.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
 drivers/rtc/rtc-tps65910.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index d0244d7..8c5ca11 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -375,6 +375,11 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
 
 	tps65910 = dev_get_drvdata(pdev->dev.parent);
 
+	if (!tps65910->chip_irq) {
+		dev_warn(&pdev->dev, "No interrupt support, not created\n");
+		return -EINVAL;
+	}
+
 	tps_rtc = devm_kzalloc(&pdev->dev, sizeof(struct tps65910_rtc),
 			GFP_KERNEL);
 	if (!tps_rtc)
-- 
1.9.1

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

* Re: [PATCH]  driver: rtc: tps65910: Add parameter check
  2017-03-15 10:52 ` [rtc-linux] " Daniel Schultz
@ 2017-04-03 11:01   ` Alexandre Belloni
  -1 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2017-04-03 11:01 UTC (permalink / raw)
  To: Daniel Schultz; +Cc: a.zummo, rtc-linux, linux-kernel

Hi,

On 15/03/2017 at 11:52:32 +0100, Daniel Schultz wrote:
> If the tps65910 driver has no interrupt, the probe of tps65910-rtc will
> fail.
> 
> This patch adds a check in the probe of the rtc if an interrupt exist.
> The check is similar to the check in the function which creates the
> interrupt.
> 

Can you elaborate on what this is fixing? If the probe already fails I'm
not sure why your patch is also making it fail.

> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
> ---
>  drivers/rtc/rtc-tps65910.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
> index d0244d7..8c5ca11 100644
> --- a/drivers/rtc/rtc-tps65910.c
> +++ b/drivers/rtc/rtc-tps65910.c
> @@ -375,6 +375,11 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
>  
>  	tps65910 = dev_get_drvdata(pdev->dev.parent);
>  
> +	if (!tps65910->chip_irq) {
> +		dev_warn(&pdev->dev, "No interrupt support, not created\n");
> +		return -EINVAL;
> +	}
> +
>  	tps_rtc = devm_kzalloc(&pdev->dev, sizeof(struct tps65910_rtc),
>  			GFP_KERNEL);
>  	if (!tps_rtc)
> -- 
> 1.9.1
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [rtc-linux] Re: [PATCH]  driver: rtc: tps65910: Add parameter check
@ 2017-04-03 11:01   ` Alexandre Belloni
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2017-04-03 11:01 UTC (permalink / raw)
  To: Daniel Schultz; +Cc: a.zummo, rtc-linux, linux-kernel

Hi,

On 15/03/2017 at 11:52:32 +0100, Daniel Schultz wrote:
> If the tps65910 driver has no interrupt, the probe of tps65910-rtc will
> fail.
> 
> This patch adds a check in the probe of the rtc if an interrupt exist.
> The check is similar to the check in the function which creates the
> interrupt.
> 

Can you elaborate on what this is fixing? If the probe already fails I'm
not sure why your patch is also making it fail.

> Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
> ---
>  drivers/rtc/rtc-tps65910.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
> index d0244d7..8c5ca11 100644
> --- a/drivers/rtc/rtc-tps65910.c
> +++ b/drivers/rtc/rtc-tps65910.c
> @@ -375,6 +375,11 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
>  
>  	tps65910 = dev_get_drvdata(pdev->dev.parent);
>  
> +	if (!tps65910->chip_irq) {
> +		dev_warn(&pdev->dev, "No interrupt support, not created\n");
> +		return -EINVAL;
> +	}
> +
>  	tps_rtc = devm_kzalloc(&pdev->dev, sizeof(struct tps65910_rtc),
>  			GFP_KERNEL);
>  	if (!tps_rtc)
> -- 
> 1.9.1
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

end of thread, other threads:[~2017-04-03 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 10:52 [PATCH] driver: rtc: tps65910: Add parameter check Daniel Schultz
2017-03-15 10:52 ` [rtc-linux] " Daniel Schultz
2017-04-03 11:01 ` Alexandre Belloni
2017-04-03 11:01   ` [rtc-linux] " Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.