Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358394
b: refs/heads/master
c: 295a7f6
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas committed Jan 10, 2013
1 parent dfddd65 commit d996617
Show file tree
Hide file tree
Showing 29 changed files with 287 additions and 508 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e84813c0cba2af80f0910484f5ba4931375f57ba
refs/heads/master: 295a7f6235bfa21be3454aebc1bea1eaf0b74fb7
1 change: 1 addition & 0 deletions trunk/arch/frv/mb93090-mb00/pci-frv.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void pcibios_resource_survey(void);
/* pci-vdk.c */

extern int __nongpreldata pcibios_last_bus;
extern struct pci_bus *__nongpreldata pci_root_bus;
extern struct pci_ops *__nongpreldata pci_root_ops;

/* pci-irq.c */
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/frv/mb93090-mb00/pci-vdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
unsigned int __nongpreldata pci_probe = 1;

int __nongpreldata pcibios_last_bus = -1;
struct pci_bus *__nongpreldata pci_root_bus;
struct pci_ops *__nongpreldata pci_root_ops;

/*
Expand Down Expand Up @@ -415,7 +416,8 @@ int __init pcibios_init(void)
printk("PCI: Probing PCI hardware\n");
pci_add_resource(&resources, &pci_ioport_resource);
pci_add_resource(&resources, &pci_iomem_resource);
pci_scan_root_bus(NULL, 0, pci_root_ops, NULL, &resources);
pci_root_bus = pci_scan_root_bus(NULL, 0, pci_root_ops, NULL,
&resources);

pcibios_irq_init();
pcibios_fixup_peer_bridges();
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/mn10300/unit-asb2305/pci-asb2305.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern void pcibios_resource_survey(void);
/* pci.c */

extern int pcibios_last_bus;
extern struct pci_bus *pci_root_bus;
extern struct pci_ops *pci_root_ops;

extern struct irq_routing_table *pcibios_get_irq_routing_table(void);
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/mn10300/unit-asb2305/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
unsigned int pci_probe = 1;

int pcibios_last_bus = -1;
struct pci_bus *pci_root_bus;
struct pci_ops *pci_root_ops;

/*
Expand Down Expand Up @@ -376,7 +377,8 @@ static int __init pcibios_init(void)

pci_add_resource_offset(&resources, &pci_ioport_resource, io_offset);
pci_add_resource_offset(&resources, &pci_iomem_resource, mem_offset);
pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL, &resources);
pci_root_bus = pci_scan_root_bus(NULL, 0, &pci_direct_ampci, NULL,
&resources);

pcibios_irq_init();
pcibios_fixup_irqs();
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/pci_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void pcibios_set_cache_line_size(void);
/* pci-pc.c */

extern int pcibios_last_bus;
extern struct pci_bus *pci_root_bus;
extern struct pci_ops pci_root_ops;

void pcibios_scan_specific_bus(int busn);
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ int noioapicreroute = 1;
#endif
int pcibios_last_bus = -1;
unsigned long pirq_table_addr;
struct pci_bus *pci_root_bus;
const struct pci_raw_ops *__read_mostly raw_pci_ops;
const struct pci_raw_ops *__read_mostly raw_pci_ext_ops;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/pci/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int __init pci_legacy_init(void)
}

printk("PCI: Probing PCI hardware\n");
pcibios_scan_root(0);
pci_root_bus = pcibios_scan_root(0);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/pci/numaq_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int __init pci_numaq_init(void)

raw_pci_ops = &pci_direct_conf1_mq;

pcibios_scan_root(0);
pci_root_bus = pcibios_scan_root(0);
if (num_online_nodes() > 1)
for_each_online_node(quad) {
if (quad == 0)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ acpi-y += resource.o
acpi-y += processor_core.o
acpi-y += ec.o
acpi-$(CONFIG_ACPI_DOCK) += dock.o
acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
acpi-y += pci_root.o pci_link.o pci_irq.o
acpi-y += acpi_platform.o
acpi-y += power.o
acpi-y += event.o
Expand Down
24 changes: 6 additions & 18 deletions trunk/drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,38 +157,26 @@ static int
acpi_memory_get_device(acpi_handle handle,
struct acpi_memory_device **mem_device)
{
acpi_status status;
acpi_handle phandle;
struct acpi_device *device = NULL;
struct acpi_device *pdevice = NULL;
int result;


if (!acpi_bus_get_device(handle, &device) && device)
goto end;

status = acpi_get_parent(handle, &phandle);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
return -EINVAL;
}

/* Get the parent device */
result = acpi_bus_get_device(phandle, &pdevice);
if (result) {
acpi_handle_warn(phandle, "Cannot get acpi bus device\n");
return -EINVAL;
}

/*
* Now add the notified device. This creates the acpi_device
* and invokes .add function
*/
result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
result = acpi_bus_add(handle);
if (result) {
acpi_handle_warn(handle, "Cannot add acpi bus\n");
return -EINVAL;
}
result = acpi_bus_get_device(handle, &device);
if (result) {
acpi_handle_warn(handle, "Missing device object\n");
return -EINVAL;
}

end:
*mem_device = acpi_driver_data(device);
Expand Down
31 changes: 6 additions & 25 deletions trunk/drivers/acpi/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,30 +135,6 @@ static int acpi_container_remove(struct acpi_device *device, int type)
return status;
}

static int container_device_add(struct acpi_device **device, acpi_handle handle)
{
acpi_handle phandle;
struct acpi_device *pdev;
int result;


if (acpi_get_parent(handle, &phandle)) {
return -ENODEV;
}

if (acpi_bus_get_device(phandle, &pdev)) {
return -ENODEV;
}

if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
return -ENODEV;
}

result = acpi_bus_start(*device);

return result;
}

static void container_notify_cb(acpi_handle handle, u32 type, void *context)
{
struct acpi_device *device = NULL;
Expand Down Expand Up @@ -190,11 +166,16 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
if (!ACPI_FAILURE(status) || device)
break;

result = container_device_add(&device, handle);
result = acpi_bus_add(handle);
if (result) {
acpi_handle_warn(handle, "Failed to add container\n");
break;
}
result = acpi_bus_get_device(handle, &device);
if (result) {
acpi_handle_warn(handle, "Missing device object\n");
break;
}

kobject_uevent(&device->dev.kobj, KOBJ_ONLINE);
ost_code = ACPI_OST_SC_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/device_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
* acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
* @dev: Device to get the ACPI node for.
*/
static struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
{
acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
struct acpi_device *adev;
Expand Down
15 changes: 4 additions & 11 deletions trunk/drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,25 +310,18 @@ static int dock_present(struct dock_station *ds)
static struct acpi_device * dock_create_acpi_device(acpi_handle handle)
{
struct acpi_device *device;
struct acpi_device *parent_device;
acpi_handle parent;
int ret;

if (acpi_bus_get_device(handle, &device)) {
/*
* no device created for this object,
* so we should create one.
*/
acpi_get_parent(handle, &parent);
if (acpi_bus_get_device(parent, &parent_device))
parent_device = NULL;

ret = acpi_bus_add(&device, parent_device, handle,
ACPI_BUS_TYPE_DEVICE);
if (ret) {
ret = acpi_bus_add(handle);
if (ret)
pr_debug("error adding bus, %x\n", -ret);
return NULL;
}

acpi_bus_get_device(handle, &device);
}
return device;
}
Expand Down
50 changes: 35 additions & 15 deletions trunk/drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type)
{
struct acpi_bus_type *tmp, *ret = NULL;

if (!type)
return NULL;

down_read(&bus_type_sem);
list_for_each_entry(tmp, &bus_type_list, list) {
if (tmp->bus == type) {
Expand Down Expand Up @@ -264,28 +267,39 @@ static int acpi_platform_notify(struct device *dev)
{
struct acpi_bus_type *type;
acpi_handle handle;
int ret = -EINVAL;
int ret;

ret = acpi_bind_one(dev, NULL);
if (!ret)
goto out;

if (!dev->bus || !dev->parent) {
if (ret && (!dev->bus || !dev->parent)) {
/* bridge devices genernally haven't bus or parent */
ret = acpi_find_bridge_device(dev, &handle);
goto end;
if (!ret) {
ret = acpi_bind_one(dev, handle);
if (ret)
goto out;
}
}

type = acpi_get_bus_type(dev->bus);
if (!type) {
DBG("No ACPI bus support for %s\n", dev_name(dev));
ret = -EINVAL;
goto end;
if (ret) {
if (!type || !type->find_device) {
DBG("No ACPI bus support for %s\n", dev_name(dev));
ret = -EINVAL;
goto out;
}

ret = type->find_device(dev, &handle);
if (ret) {
DBG("Unable to get handle for %s\n", dev_name(dev));
goto out;
}
ret = acpi_bind_one(dev, handle);
if (ret)
goto out;
}
if ((ret = type->find_device(dev, &handle)) != 0)
DBG("Can't get handler for %s\n", dev_name(dev));
end:
if (!ret)
acpi_bind_one(dev, handle);

if (type && type->setup)
type->setup(dev);

out:
#if ACPI_GLUE_DEBUG
Expand All @@ -304,6 +318,12 @@ static int acpi_platform_notify(struct device *dev)

static int acpi_platform_notify_remove(struct device *dev)
{
struct acpi_bus_type *type;

type = acpi_get_bus_type(dev->bus);
if (type && type->cleanup)
type->cleanup(dev);

acpi_unbind_one(dev);
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ struct acpi_ec {

extern struct acpi_ec *first_ec;

int acpi_pci_root_init(void);
int acpi_ec_init(void);
int acpi_ec_ecdt_probe(void);
int acpi_boot_ec_enable(void);
Expand Down
Loading

0 comments on commit d996617

Please sign in to comment.