mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: gregkh@suse.de, linuxppc-dev@ozlabs.org,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] driver core: Add ability for arch code to setup pdev_archdata
Date: Fri, 6 Aug 2010 01:43:51 +1000	[thread overview]
Message-ID: <20100806014351.a3bddf08.sfr@canb.auug.org.au> (raw)
In-Reply-To: <1281021347-1278-2-git-send-email-galak@kernel.crashing.org>

[-- Attachment #1: Type: text/plain, Size: 1757 bytes --]

Hi Kumar,

On Thu,  5 Aug 2010 10:15:45 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> --- 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>
>  
>  #include "base.h"
>  
> @@ -170,6 +171,9 @@ struct platform_device *platform_device_alloc(const char *name, int id)
>  		pa->pdev.id = id;
>  		device_initialize(&pa->pdev.dev);
>  		pa->pdev.dev.release = platform_device_release;
> +#ifdef ARCH_HAS_PDEV_ARCHDATA_SETUP
> +		arch_setup_pdev_archdata(&pa->pdev);
> +#endif
>  	}
>  
>  	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_ */

Why not do:

#include <linux/platform_device.h>

#ifndef arch_setup_pdev_archdata
static inline void arch_setup_pdev_archdata(struct platform_device *pdev) { }
#endif

in asm-generic/platform-device.h

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

#define arch_setup_pdev_archdata arch_setup_pdev_archdata

before still including asm-generic/platform_device.h

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2010-08-05 15:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05 15:15 [PATCH 0/3] " 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   ` Stephen Rothwell [this message]
2010-08-05 16:14     ` [PATCH 1/3] driver core: Add ability for arch code to setup pdev_archdata Kumar Gala
2010-08-05 18:02     ` Greg KH
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=20100806014351.a3bddf08.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=akpm@linux-foundation.org \
    --cc=galak@kernel.crashing.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    /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

all inboxes | Powered by JetHome®