All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Rob Landley <rob@landley.net>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/4] pwm_backlight: Validate dft_brightness in main probe function
Date: Thu, 31 Jan 2013 12:38:18 +0000	[thread overview]
Message-ID: <510A65BA.6090208@ti.com> (raw)
In-Reply-To: <1358861996-27194-3-git-send-email-peter.ujfalusi@ti.com>

Hi Thierry,

On 01/22/2013 02:39 PM, Peter Ujfalusi wrote:
> Move the dft_brightness validity check from the DT parsing function to the
> main probe. In this way we can validate it in case we are booting with or
> without DT.

Based on the discussion the rest of the series is going to be dropped, but
what about this single patch?
I think it is still addresses a valid issue, which is that in non DT boot we
do not check if the dft_brightness is within valid range.

I can resend this patch alone since it is not going to apply on mainline as it is.

-- 
Péter

> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  drivers/video/backlight/pwm_bl.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index f0d6854..2a81c24 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -135,12 +135,6 @@ static int pwm_backlight_parse_dt(struct device *dev,
>  		if (ret < 0)
>  			return ret;
>  
> -		if (value >= data->max_brightness) {
> -			dev_warn(dev, "invalid default brightness level: %u, using %u\n",
> -				 value, data->max_brightness - 1);
> -			value = data->max_brightness - 1;
> -		}
> -
>  		data->dft_brightness = value;
>  	}
>  
> @@ -249,6 +243,12 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  		goto err_alloc;
>  	}
>  
> +	if (data->dft_brightness > data->max_brightness) {
> +		dev_warn(&pdev->dev,
> +			 "invalid default brightness level: %u, using %u\n",
> +			 data->dft_brightness, data->max_brightness);
> +		data->dft_brightness = data->max_brightness;
> +	}
>  	bl->props.brightness = data->dft_brightness;
>  	backlight_update_status(bl);
>  
> 

WARNING: multiple messages have this Message-ID (diff)
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Rob Landley <rob@landley.net>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/4] pwm_backlight: Validate dft_brightness in main probe function
Date: Thu, 31 Jan 2013 13:38:18 +0100	[thread overview]
Message-ID: <510A65BA.6090208@ti.com> (raw)
In-Reply-To: <1358861996-27194-3-git-send-email-peter.ujfalusi@ti.com>

Hi Thierry,

On 01/22/2013 02:39 PM, Peter Ujfalusi wrote:
> Move the dft_brightness validity check from the DT parsing function to the
> main probe. In this way we can validate it in case we are booting with or
> without DT.

Based on the discussion the rest of the series is going to be dropped, but
what about this single patch?
I think it is still addresses a valid issue, which is that in non DT boot we
do not check if the dft_brightness is within valid range.

I can resend this patch alone since it is not going to apply on mainline as it is.

-- 
Péter

> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  drivers/video/backlight/pwm_bl.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index f0d6854..2a81c24 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -135,12 +135,6 @@ static int pwm_backlight_parse_dt(struct device *dev,
>  		if (ret < 0)
>  			return ret;
>  
> -		if (value >= data->max_brightness) {
> -			dev_warn(dev, "invalid default brightness level: %u, using %u\n",
> -				 value, data->max_brightness - 1);
> -			value = data->max_brightness - 1;
> -		}
> -
>  		data->dft_brightness = value;
>  	}
>  
> @@ -249,6 +243,12 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  		goto err_alloc;
>  	}
>  
> +	if (data->dft_brightness > data->max_brightness) {
> +		dev_warn(&pdev->dev,
> +			 "invalid default brightness level: %u, using %u\n",
> +			 data->dft_brightness, data->max_brightness);
> +		data->dft_brightness = data->max_brightness;
> +	}
>  	bl->props.brightness = data->dft_brightness;
>  	backlight_update_status(bl);
>  
> 

WARNING: multiple messages have this Message-ID (diff)
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Rob Landley <rob@landley.net>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	<devicetree-discuss@lists.ozlabs.org>,
	<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-fbdev@vger.kernel.org>
Subject: Re: [PATCH 2/4] pwm_backlight: Validate dft_brightness in main probe function
Date: Thu, 31 Jan 2013 13:38:18 +0100	[thread overview]
Message-ID: <510A65BA.6090208@ti.com> (raw)
In-Reply-To: <1358861996-27194-3-git-send-email-peter.ujfalusi@ti.com>

Hi Thierry,

On 01/22/2013 02:39 PM, Peter Ujfalusi wrote:
> Move the dft_brightness validity check from the DT parsing function to the
> main probe. In this way we can validate it in case we are booting with or
> without DT.

Based on the discussion the rest of the series is going to be dropped, but
what about this single patch?
I think it is still addresses a valid issue, which is that in non DT boot we
do not check if the dft_brightness is within valid range.

I can resend this patch alone since it is not going to apply on mainline as it is.

-- 
Péter

> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  drivers/video/backlight/pwm_bl.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index f0d6854..2a81c24 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -135,12 +135,6 @@ static int pwm_backlight_parse_dt(struct device *dev,
>  		if (ret < 0)
>  			return ret;
>  
> -		if (value >= data->max_brightness) {
> -			dev_warn(dev, "invalid default brightness level: %u, using %u\n",
> -				 value, data->max_brightness - 1);
> -			value = data->max_brightness - 1;
> -		}
> -
>  		data->dft_brightness = value;
>  	}
>  
> @@ -249,6 +243,12 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  		goto err_alloc;
>  	}
>  
> +	if (data->dft_brightness > data->max_brightness) {
> +		dev_warn(&pdev->dev,
> +			 "invalid default brightness level: %u, using %u\n",
> +			 data->dft_brightness, data->max_brightness);
> +		data->dft_brightness = data->max_brightness;
> +	}
>  	bl->props.brightness = data->dft_brightness;
>  	backlight_update_status(bl);
>  
> 

  reply	other threads:[~2013-01-31 12:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 13:39 [PATCH 0/4] pwm_backlight: Error fixes and update for DT support Peter Ujfalusi
2013-01-22 13:39 ` Peter Ujfalusi
2013-01-22 13:39 ` Peter Ujfalusi
2013-01-22 13:39 ` [PATCH 1/4] pwm_backlight: Fix PWM levels support in non DT case Peter Ujfalusi
2013-01-22 13:39   ` Peter Ujfalusi
2013-01-22 13:39   ` Peter Ujfalusi
2013-01-28 21:01   ` Thierry Reding
2013-01-28 21:01     ` Thierry Reding
2013-01-29  8:17     ` Peter Ujfalusi
2013-01-29  8:17       ` Peter Ujfalusi
2013-01-29  8:17       ` Peter Ujfalusi
     [not found]       ` <51078580.2000808-l0cyMroinI0@public.gmane.org>
2013-01-29 10:17         ` Thierry Reding
2013-01-29 10:17           ` Thierry Reding
2013-01-29 10:17           ` Thierry Reding
     [not found]           ` <20130129101709.GC16746-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-01-29 12:10             ` Peter Ujfalusi
2013-01-29 12:10               ` Peter Ujfalusi
2013-01-29 12:10               ` Peter Ujfalusi
2013-01-29 12:30               ` Thierry Reding
2013-01-29 12:30                 ` Thierry Reding
2013-01-30  7:34                 ` Peter Ujfalusi
2013-01-30  7:34                   ` Peter Ujfalusi
2013-01-30  7:34                   ` Peter Ujfalusi
     [not found] ` <1358861996-27194-1-git-send-email-peter.ujfalusi-l0cyMroinI0@public.gmane.org>
2013-01-22 13:39   ` [PATCH 2/4] pwm_backlight: Validate dft_brightness in main probe function Peter Ujfalusi
2013-01-22 13:39     ` Peter Ujfalusi
2013-01-22 13:39     ` Peter Ujfalusi
2013-01-31 12:38     ` Peter Ujfalusi [this message]
2013-01-31 12:38       ` Peter Ujfalusi
2013-01-31 12:38       ` Peter Ujfalusi
2013-01-31 12:58       ` Thierry Reding
2013-01-31 12:58         ` Thierry Reding
2013-01-22 13:39   ` [PATCH 3/4] pwm_backlight: Refactor the DT parsing code Peter Ujfalusi
2013-01-22 13:39     ` Peter Ujfalusi
2013-01-22 13:39     ` Peter Ujfalusi
2013-01-22 13:39 ` [PATCH 4/4] pwm_backlight: Add support for the whole range of the PWM in DT mode Peter Ujfalusi
2013-01-22 13:39   ` Peter Ujfalusi
2013-01-22 13:39   ` Peter Ujfalusi
2013-01-29 10:00   ` Thierry Reding
2013-01-29 10:00     ` Thierry Reding

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=510A65BA.6090208@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=rpurdie@rpsys.net \
    --cc=thierry.reding@avionic-design.de \
    /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 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.