lkml.org 
[lkml]   [2013]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v8 22/22] PCI: move device_add out of pci_bus_add_device()
From
On Tue, Jan 15, 2013 at 6:29 PM, Yijing Wang <wangyijing@huawei.com> wrote:
> On 2013/1/12 6:40, Yinghai Lu wrote:
>> Move out device registering out of pci_bus_add_devices, so we could
>> put new created pci devices in device tree early.
>>
>> new pci_bus_add_devices will do the device_attach work to load pci drivers
>> instead.
>>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>> ---
>> drivers/pci/bus.c | 47 +++--------------------------------------------
>> drivers/pci/iov.c | 7 -------
>> drivers/pci/probe.c | 34 +++++++++++++++++++++++++++-------
>> 3 files changed, 30 insertions(+), 58 deletions(-)
>>
>> diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
>> index 1f5916a..0a55845 100644
>> --- a/drivers/pci/bus.c
>> +++ b/drivers/pci/bus.c
>> @@ -178,22 +178,9 @@ static void pci_bus_attach_device(struct pci_dev *dev)
>> */
>> int pci_bus_add_device(struct pci_dev *dev)
>> {
>> - int retval;
>> -
>> - pci_fixup_device(pci_fixup_final, dev);
>> -
>> - retval = pcibios_add_device(dev);
>> - if (retval)
>> - return retval;
>> -
>> - retval = device_add(&dev->dev);
>> - if (retval)
>> - return retval;
>> -
>> pci_bus_attach_device(dev);
>> dev->is_added = 1;
>> - pci_proc_attach_device(dev);
>> - pci_create_sysfs_dev_files(dev);
>> +
>> return 0;
>> }
>
>
> Hi Yinghai,
> Should change pci_bus_add_device() function to void return now? So some unnecessary ret check can remove.
>

yeah, maybe later. this patch is already some kind of big now.

also there is outside caller...

drivers/edac/i82875p_edac.c: err = pci_bus_add_device(dev);
drivers/platform/x86/asus-wmi.c: if
(pci_bus_add_device(dev))
drivers/platform/x86/eeepc-laptop.c: if
(pci_bus_add_device(dev))

so let change that later.

Thanks

Yinghai


\
 
 \ /
  Last update: 2013-01-16 04:21    [W:0.126 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site