linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/6] mach-ux500: remove intermediary add_platform_device* functions
Date: Wed, 19 Oct 2011 15:43:04 +0100	[thread overview]
Message-ID: <4E9EE1F8.7060207@linaro.org> (raw)
In-Reply-To: <20111017115908.GE4992@totoro>

On 17/10/11 12:59, Jamie Iles wrote:
> Hi Lee,
> 
> On Mon, Oct 17, 2011 at 12:52:58PM +0100, Lee Jones wrote:
>> These are no longer required since a 'parent' pointer is now
>> passed to each registering device.
>>
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> ---
>>  arch/arm/mach-ux500/devices-common.c |   53 ----------------------------------
>>  arch/arm/mach-ux500/devices-common.h |   34 +++++++++------------
>>  arch/arm/mach-ux500/devices-db8500.h |   10 ++++--
>>  3 files changed, 22 insertions(+), 75 deletions(-)
>>
>> diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c
>> index b8d9a99..170975f 100644
>> --- a/arch/arm/mach-ux500/devices-common.c
>> +++ b/arch/arm/mach-ux500/devices-common.c
>> @@ -59,59 +59,6 @@ dbx500_add_amba_device(struct device *parent, const char *name,
>>  }
>>  
>>  static struct platform_device *
>> -dbx500_add_platform_device(const char *name, int id, void *pdata,
>> -			   struct resource *res, int resnum)
>> -{
>> -	struct platform_device *dev;
>> -	int ret;
>> -
>> -	dev = platform_device_alloc(name, id);
>> -	if (!dev)
>> -		return ERR_PTR(-ENOMEM);
>> -
>> -	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>> -	dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
>> -
>> -	ret = platform_device_add_resources(dev, res, resnum);
>> -	if (ret)
>> -		goto out_free;
>> -
>> -	dev->dev.platform_data = pdata;
>> -
>> -	ret = platform_device_add(dev);
>> -	if (ret)
>> -		goto out_free;
>> -
>> -	return dev;
>> -
>> -out_free:
>> -	platform_device_put(dev);
>> -	return ERR_PTR(ret);
>> -}
> [...]
>> diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
>> index f8adff8..089371e 100644
>> --- a/arch/arm/mach-ux500/devices-common.h
>> +++ b/arch/arm/mach-ux500/devices-common.h
> [...]
>> -static inline struct platform_device *
>> -dbx500_add_msp_i2s(int id, resource_size_t base, int irq,
>> -		   struct msp_i2s_platform_data *pdata)
>> -{
>> -	return dbx500_add_platform_device_4k1irq("MSP_I2S", id, base, irq,
>> -						 pdata);
>> +	struct resource resources[] = {
>> +		DEFINE_RES_MEM(base, SZ_4K),
>> +		DEFINE_RES_IRQ(irq),
>> +	};
>> +
>> +	return platform_device_register_resndata(parent, "nmk-i2c",
>> +						 id, resources,
>> +						 ARRAY_SIZE(resources),
>> +						 pdata, sizeof(*pdata));
>>  }
> 
> I think you need platform_device_register_full() rather than 
> platform_device_register_resndata() here as dbx500_add_platform_device() 
> also set a dma mask which platform_device_register_resndata() doesn't 
> do.  Otherwise a nice diffstat!

Good spot.

I can't seem to find platform_device_register_full(). Does it exist?

  reply	other threads:[~2011-10-19 14:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 11:52 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2011-10-17 11:52 ` [PATCH 1/6] mach-ux500: pass parent pointer to each platform device Lee Jones
2011-10-17 11:52 ` [PATCH 2/6] drivers/base: add bus for System-on-Chip devices Lee Jones
2011-10-17 12:13   ` Jamie Iles
2011-10-17 16:16   ` Greg KH
2011-10-17 18:03     ` Arnd Bergmann
2011-10-17 18:25       ` Greg KH
2011-10-18 14:00         ` Arnd Bergmann
2011-10-18 14:44           ` Greg KH
2011-10-18 11:12     ` Lee Jones
2011-10-18 14:14       ` Arnd Bergmann
2011-10-18 14:41         ` Greg KH
2011-10-18 14:43       ` Greg KH
2011-10-17 16:18   ` Greg KH
2011-10-18 11:14     ` Lee Jones
2011-10-18 14:05       ` Arnd Bergmann
2011-10-18 14:15         ` Jamie Iles
2011-10-18 14:38           ` Greg KH
2011-10-18 14:53           ` Arnd Bergmann
2011-10-18 14:56             ` Jamie Iles
2011-10-17 11:52 ` [PATCH 3/6] Documentation: add information for new sysfs soc bus functionality Lee Jones
2011-10-17 11:52 ` [PATCH 4/6] mach-ux500: export System-on-Chip information ux500 via sysfs Lee Jones
2011-10-17 11:52 ` [PATCH 5/6] mach-ux500: move top level platform devices in sysfs to /sys/devices/socX Lee Jones
2011-10-17 11:52 ` [PATCH 6/6] mach-ux500: remove intermediary add_platform_device* functions Lee Jones
2011-10-17 11:59   ` Jamie Iles
2011-10-19 14:43     ` Lee Jones [this message]
2011-10-19 14:45       ` Jamie Iles
  -- strict thread matches above, loose matches on Subject: below --
2012-01-20 16:10 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-01-20 16:10 ` [PATCH 6/6] mach-ux500: remove intermediary add_platform_device* functions Lee Jones
2012-01-21 17:08 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-01-21 17:08 ` [PATCH 6/6] mach-ux500: remove intermediary add_platform_device* functions Lee Jones
2012-02-01  9:23 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-02-01  9:23 ` [PATCH 6/6] mach-ux500: remove intermediary add_platform_device* functions Lee Jones
2012-02-06 19:22 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-02-06 19:22 ` [PATCH 6/6] mach-ux500: remove intermediary add_platform_device* functions Lee Jones

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=4E9EE1F8.7060207@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).