From: Kumar Gala <galak@kernel.crashing.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linuxppc-dev@ozlabs.org, akpm@linux-foundation.org,
gregkh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] driver core: Add ability for arch code to setup pdev_archdata
Date: Thu, 5 Aug 2010 11:14:48 -0500 [thread overview]
Message-ID: <2F334348-411C-450A-AEC9-5DF3916E9BBC@kernel.crashing.org> (raw)
In-Reply-To: <20100806014351.a3bddf08.sfr@canb.auug.org.au>
On Aug 5, 2010, at 10:43 AM, Stephen Rothwell wrote:
> Hi Kumar,
>=20
> On Thu, 5 Aug 2010 10:15:45 -0500 Kumar Gala =
<galak@kernel.crashing.org> wrote:
>>=20
>> --- a/drivers/base/platform.c
>> +++ b/drivers/base/platform.c
>> @@ -19,6 +19,7 @@
>> #include <linux/err.h>
>> #include <linux/slab.h>
>> #include <linux/pm_runtime.h>
>> +#include <asm/platform_device.h>
>>=20
>> #include "base.h"
>>=20
>> @@ -170,6 +171,9 @@ struct platform_device =
*platform_device_alloc(const char *name, int id)
>> pa->pdev.id =3D id;
>> device_initialize(&pa->pdev.dev);
>> pa->pdev.dev.release =3D platform_device_release;
>> +#ifdef ARCH_HAS_PDEV_ARCHDATA_SETUP
>> + arch_setup_pdev_archdata(&pa->pdev);
>> +#endif
>> }
>>=20
>> return pa ? &pa->pdev : NULL;
>> diff --git a/include/asm-generic/platform_device.h =
b/include/asm-generic/platform_device.h
>> new file mode 100644
>> index 0000000..64806dc
>> --- /dev/null
>> +++ b/include/asm-generic/platform_device.h
>> @@ -0,0 +1,7 @@
>> +#ifndef __ASM_GENERIC_PLATFORM_DEVICE_H_
>> +#define __ASM_GENERIC_PLATFORM_DEVICE_H_
>> +/*
>> + * an architecture can override to define arch_setup_pdev_archdata
>> + */
>> +
>> +#endif /* __ASM_GENERIC_PLATFORM_DEVICE_H_ */
>=20
> Why not do:
>=20
> #include <linux/platform_device.h>
>=20
> #ifndef arch_setup_pdev_archdata
> static inline void arch_setup_pdev_archdata(struct platform_device =
*pdev) { }
> #endif
>=20
> in asm-generic/platform-device.h
>=20
> and the the call in platform_device_alloc() can be unconditional. If =
the arch wants to override arch_setup_pdev_archdata, it defines the =
function and then does
>=20
> #define arch_setup_pdev_archdata arch_setup_pdev_archdata
>=20
> before still including asm-generic/platform_device.h
I've got no issues with the style change.
- k=
next prev parent reply other threads:[~2010-08-05 16:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 15:15 [PATCH 0/3] driver core: Add ability for arch code to setup pdev_archdata Kumar Gala
2010-08-05 15:15 ` [PATCH 1/3] " Kumar Gala
2010-08-05 15:15 ` [PATCH 2/3] powerpc: implement arch_setup_pdev_archdata Kumar Gala
2010-08-05 15:15 ` [PATCH 3/3] powerpc: Dont require a dma_ops struct to set dma mask Kumar Gala
2010-08-05 15:44 ` [PATCH 2/3] powerpc: implement arch_setup_pdev_archdata Stephen Rothwell
2010-08-05 16:14 ` Kumar Gala
2010-08-05 15:43 ` [PATCH 1/3] driver core: Add ability for arch code to setup pdev_archdata Stephen Rothwell
2010-08-05 16:14 ` Kumar Gala [this message]
2010-08-05 18:02 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2011-06-22 12:02 Kumar Gala
2011-06-22 14:37 ` Mike Frysinger
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=2F334348-411C-450A-AEC9-5DF3916E9BBC@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=sfr@canb.auug.org.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).