* [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register()
@ 2008-09-13 6:32 Zev Weiss
2008-09-13 10:45 ` Lennert Buytenhek
2008-09-17 18:57 ` Andrew Morton
0 siblings, 2 replies; 6+ messages in thread
From: Zev Weiss @ 2008-09-13 6:32 UTC (permalink / raw)
To: linux-mtd, linux-kernel
The PHYSMAP_COMPAT code had been ignoring the return value of
platform_device_register() in the physmap_init() function.
Signed-off-by: Zev Weiss <zevweiss@gmail.com>
---
drivers/mtd/maps/physmap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 42d844f..6fba0d4 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -312,7 +312,7 @@ static int __init physmap_init(void)
err = platform_driver_register(&physmap_flash_driver);
#ifdef PHYSMAP_COMPAT
if (err == 0)
- platform_device_register(&physmap_flash);
+ err = platform_device_register(&physmap_flash);
#endif
return err;
--
1.5.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register()
2008-09-13 6:32 [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register() Zev Weiss
@ 2008-09-13 10:45 ` Lennert Buytenhek
2008-09-13 11:27 ` Zev Weiss
2008-09-17 18:57 ` Andrew Morton
1 sibling, 1 reply; 6+ messages in thread
From: Lennert Buytenhek @ 2008-09-13 10:45 UTC (permalink / raw)
To: Zev Weiss; +Cc: linux-mtd, linux-kernel
On Fri, Sep 12, 2008 at 11:32:58PM -0700, Zev Weiss wrote:
> The PHYSMAP_COMPAT code had been ignoring the return value of
> platform_device_register() in the physmap_init() function.
>
> Signed-off-by: Zev Weiss <zevweiss@gmail.com>
> ---
> drivers/mtd/maps/physmap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
> index 42d844f..6fba0d4 100644
> --- a/drivers/mtd/maps/physmap.c
> +++ b/drivers/mtd/maps/physmap.c
> @@ -312,7 +312,7 @@ static int __init physmap_init(void)
> err = platform_driver_register(&physmap_flash_driver);
> #ifdef PHYSMAP_COMPAT
> if (err == 0)
> - platform_device_register(&physmap_flash);
> + err = platform_device_register(&physmap_flash);
> #endif
I don't think you want the registration of the physmap driver to fail
if the compat platform device fails to register.
One reason that the compat platform device can fail to register can be
that there is already a non-compat platform device for the compat flash
chip, and in that case I don't think you want to fail the driver init
(while leaving the physmap_flash_driver registered, too!).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register()
2008-09-13 10:45 ` Lennert Buytenhek
@ 2008-09-13 11:27 ` Zev Weiss
0 siblings, 0 replies; 6+ messages in thread
From: Zev Weiss @ 2008-09-13 11:27 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: linux-mtd, linux-kernel
Lennert Buytenhek wrote:
> On Fri, Sep 12, 2008 at 11:32:58PM -0700, Zev Weiss wrote:
>
>> The PHYSMAP_COMPAT code had been ignoring the return value of
>> platform_device_register() in the physmap_init() function.
>>
>> Signed-off-by: Zev Weiss <zevweiss@gmail.com>
>> ---
>> drivers/mtd/maps/physmap.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
>> index 42d844f..6fba0d4 100644
>> --- a/drivers/mtd/maps/physmap.c
>> +++ b/drivers/mtd/maps/physmap.c
>> @@ -312,7 +312,7 @@ static int __init physmap_init(void)
>> err = platform_driver_register(&physmap_flash_driver);
>> #ifdef PHYSMAP_COMPAT
>> if (err == 0)
>> - platform_device_register(&physmap_flash);
>> + err = platform_device_register(&physmap_flash);
>> #endif
>
> I don't think you want the registration of the physmap driver to fail
> if the compat platform device fails to register.
>
> One reason that the compat platform device can fail to register can be
> that there is already a non-compat platform device for the compat flash
> chip, and in that case I don't think you want to fail the driver init
> (while leaving the physmap_flash_driver registered, too!).
>
Chalk another one up to ignorance on my part...sounds like a nak all 'round.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register()
2008-09-13 6:32 [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register() Zev Weiss
2008-09-13 10:45 ` Lennert Buytenhek
@ 2008-09-17 18:57 ` Andrew Morton
2008-09-17 19:43 ` Sergei Shtylyov
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2008-09-17 18:57 UTC (permalink / raw)
To: Zev Weiss; +Cc: linux-mtd, linux-kernel
On Fri, 12 Sep 2008 23:32:58 -0700
Zev Weiss <zevweiss@gmail.com> wrote:
> The PHYSMAP_COMPAT code had been ignoring the return value of
> platform_device_register() in the physmap_init() function.
>
> Signed-off-by: Zev Weiss <zevweiss@gmail.com>
> ---
> drivers/mtd/maps/physmap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
> index 42d844f..6fba0d4 100644
> --- a/drivers/mtd/maps/physmap.c
> +++ b/drivers/mtd/maps/physmap.c
> @@ -312,7 +312,7 @@ static int __init physmap_init(void)
> err = platform_driver_register(&physmap_flash_driver);
> #ifdef PHYSMAP_COMPAT
> if (err == 0)
> - platform_device_register(&physmap_flash);
> + err = platform_device_register(&physmap_flash);
> #endif
>
> return err;
Your email client is performing space-stuffing, thus making the patches
unapplyable.
Presumably we should run platform_driver_unregister() if the
platform_device_register() failed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register()
2008-09-17 18:57 ` Andrew Morton
@ 2008-09-17 19:43 ` Sergei Shtylyov
2008-09-17 19:46 ` Sergei Shtylyov
0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2008-09-17 19:43 UTC (permalink / raw)
To: Andrew Morton; +Cc: Zev Weiss, linux-mtd, linux-kernel
Hello.
Andrew Morton wrote:
>>The PHYSMAP_COMPAT code had been ignoring the return value of
>>platform_device_register() in the physmap_init() function.
>>Signed-off-by: Zev Weiss <zevweiss@gmail.com>
[...]
>>diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
>>index 42d844f..6fba0d4 100644
>>--- a/drivers/mtd/maps/physmap.c
>>+++ b/drivers/mtd/maps/physmap.c
>>@@ -312,7 +312,7 @@ static int __init physmap_init(void)
>> err = platform_driver_register(&physmap_flash_driver);
>> #ifdef PHYSMAP_COMPAT
>> if (err == 0)
>>- platform_device_register(&physmap_flash);
>>+ err = platform_device_register(&physmap_flash);
>> #endif
>>
>> return err;
> Your email client is performing space-stuffing, thus making the patches
> unapplyable.
Er... are you sure? The patch looks alright tab wise, even after quoting...
> Presumably we should run platform_driver_unregister() if the
> platform_device_register() failed.
Why is that? There could be "normal" platform devices out there...
WBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register()
2008-09-17 19:43 ` Sergei Shtylyov
@ 2008-09-17 19:46 ` Sergei Shtylyov
0 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2008-09-17 19:46 UTC (permalink / raw)
To: Andrew Morton; +Cc: Zev Weiss, linux-mtd, linux-kernel
I just wrote:
>>> The PHYSMAP_COMPAT code had been ignoring the return value of
>>> platform_device_register() in the physmap_init() function.
>>> Signed-off-by: Zev Weiss <zevweiss@gmail.com>
> [...]
>>> diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
>>> index 42d844f..6fba0d4 100644
>>> --- a/drivers/mtd/maps/physmap.c
>>> +++ b/drivers/mtd/maps/physmap.c
>>> @@ -312,7 +312,7 @@ static int __init physmap_init(void)
>>> err = platform_driver_register(&physmap_flash_driver);
>>> #ifdef PHYSMAP_COMPAT
>>> if (err == 0)
>>> - platform_device_register(&physmap_flash);
>>> + err = platform_device_register(&physmap_flash);
>>> #endif
>>>
>>> return err;
[...]
>> Presumably we should run platform_driver_unregister() if the
>> platform_device_register() failed.
> Why is that? There could be "normal" platform devices out there...
With that said, the patch is pointless (as already noted by Lennert).
WBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-09-17 19:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-13 6:32 [PATCH 1/3] [MTD] physmap.c: Check return of platform_device_register() Zev Weiss
2008-09-13 10:45 ` Lennert Buytenhek
2008-09-13 11:27 ` Zev Weiss
2008-09-17 18:57 ` Andrew Morton
2008-09-17 19:43 ` Sergei Shtylyov
2008-09-17 19:46 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox