Re: [PATCH 1/4] [media] s3c-camif: Remove redundant NULL check

2013-05-01 Thread Sachin Kamat
On 1 May 2013 15:02, Sylwester Nawrocki  wrote:
> On 04/30/2013 08:16 AM, Sachin Kamat wrote:
>>
>> clk_unprepare checks for NULL pointer. Hence convert IS_ERR_OR_NULL
>> to IS_ERR only.
>>
>> Signed-off-by: Sachin Kamat
>> ---
>>   drivers/media/platform/s3c-camif/camif-core.c |2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/platform/s3c-camif/camif-core.c
>> b/drivers/media/platform/s3c-camif/camif-core.c
>> index 0d0fab1..2449f13 100644
>> --- a/drivers/media/platform/s3c-camif/camif-core.c
>> +++ b/drivers/media/platform/s3c-camif/camif-core.c
>> @@ -341,7 +341,7 @@ static void camif_clk_put(struct camif_dev *camif)
>> int i;
>>
>> for (i = 0; i<  CLK_MAX_NUM; i++) {
>> -   if (IS_ERR_OR_NULL(camif->clock[i]))
>> +   if (IS_ERR(camif->clock[i]))
>> continue;
>> clk_unprepare(camif->clock[i]);
>> clk_put(camif->clock[i]);
>
>
> Patch applied for 3.11 with following chunk squashed to it:

Thanks Sylwester.


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] [media] s3c-camif: Remove redundant NULL check

2013-05-01 Thread Sylwester Nawrocki

On 04/30/2013 08:16 AM, Sachin Kamat wrote:

clk_unprepare checks for NULL pointer. Hence convert IS_ERR_OR_NULL
to IS_ERR only.

Signed-off-by: Sachin Kamat
---
  drivers/media/platform/s3c-camif/camif-core.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/s3c-camif/camif-core.c 
b/drivers/media/platform/s3c-camif/camif-core.c
index 0d0fab1..2449f13 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -341,7 +341,7 @@ static void camif_clk_put(struct camif_dev *camif)
int i;

for (i = 0; i<  CLK_MAX_NUM; i++) {
-   if (IS_ERR_OR_NULL(camif->clock[i]))
+   if (IS_ERR(camif->clock[i]))
continue;
clk_unprepare(camif->clock[i]);
clk_put(camif->clock[i]);


Patch applied for 3.11 with following chunk squashed to it:

diff --git a/drivers/media/platform/s3c-camif/camif-core.c 
b/drivers/media/platform/s3c-camif/camif-core.c

index 2449f13..b385747 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -345,6 +345,7 @@ static void camif_clk_put(struct camif_dev *camif)
continue;
clk_unprepare(camif->clock[i]);
clk_put(camif->clock[i]);
+   camif->clock[i] = ERR_PTR(-EINVAL);
}
 }

@@ -352,6 +353,9 @@ static int camif_clk_get(struct camif_dev *camif)
 {
int ret, i;

+   for (i = 1; i < CLK_MAX_NUM; i++)
+   camif->clock[i] = ERR_PTR(-EINVAL);
+
for (i = 0; i < CLK_MAX_NUM; i++) {
camif->clock[i] = clk_get(camif->dev, camif_clocks[i]);
if (IS_ERR(camif->clock[i])) {

Thanks!
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] [media] s3c-camif: Remove redundant NULL check

2013-04-29 Thread Sachin Kamat
clk_unprepare checks for NULL pointer. Hence convert IS_ERR_OR_NULL
to IS_ERR only.

Signed-off-by: Sachin Kamat 
---
 drivers/media/platform/s3c-camif/camif-core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/s3c-camif/camif-core.c 
b/drivers/media/platform/s3c-camif/camif-core.c
index 0d0fab1..2449f13 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -341,7 +341,7 @@ static void camif_clk_put(struct camif_dev *camif)
int i;
 
for (i = 0; i < CLK_MAX_NUM; i++) {
-   if (IS_ERR_OR_NULL(camif->clock[i]))
+   if (IS_ERR(camif->clock[i]))
continue;
clk_unprepare(camif->clock[i]);
clk_put(camif->clock[i]);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html