Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66bef8c0 authored by Harvey Harrison's avatar Harvey Harrison Committed by Greg Kroah-Hartman
Browse files

PCI: replace remaining __FUNCTION__ occurrences



__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ca99eb8c
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@


#define MY_NAME	"acpi_pcihp"
#define MY_NAME	"acpi_pcihp"


#define dbg(fmt, arg...) do { if (debug_acpi) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0)
#define dbg(fmt, arg...) do { if (debug_acpi) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __func__ , ## arg); } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
#define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
#define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
#define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
@@ -71,7 +71,7 @@ decode_type0_hpx_record(union acpi_object *record, struct hotplug_params *hpx)
	default:
	default:
		printk(KERN_WARNING
		printk(KERN_WARNING
		       "%s: Type 0 Revision %d record not supported\n",
		       "%s: Type 0 Revision %d record not supported\n",
		       __FUNCTION__, revision);
		       __func__, revision);
		return AE_ERROR;
		return AE_ERROR;
	}
	}
	return AE_OK;
	return AE_OK;
@@ -100,7 +100,7 @@ decode_type1_hpx_record(union acpi_object *record, struct hotplug_params *hpx)
	default:
	default:
		printk(KERN_WARNING
		printk(KERN_WARNING
		       "%s: Type 1 Revision %d record not supported\n",
		       "%s: Type 1 Revision %d record not supported\n",
		       __FUNCTION__, revision);
		       __func__, revision);
		return AE_ERROR;
		return AE_ERROR;
	}
	}
	return AE_OK;
	return AE_OK;
@@ -142,7 +142,7 @@ decode_type2_hpx_record(union acpi_object *record, struct hotplug_params *hpx)
	default:
	default:
		printk(KERN_WARNING
		printk(KERN_WARNING
		       "%s: Type 2 Revision %d record not supported\n",
		       "%s: Type 2 Revision %d record not supported\n",
		       __FUNCTION__, revision);
		       __func__, revision);
		return AE_ERROR;
		return AE_ERROR;
	}
	}
	return AE_OK;
	return AE_OK;
@@ -203,7 +203,7 @@ acpi_run_hpx(acpi_handle handle, struct hotplug_params *hpx)
			break;
			break;
		default:
		default:
			printk(KERN_ERR "%s: Type %d record not supported\n",
			printk(KERN_ERR "%s: Type %d record not supported\n",
			       __FUNCTION__, type);
			       __func__, type);
			status = AE_ERROR;
			status = AE_ERROR;
			goto exit;
			goto exit;
		}
		}
@@ -235,7 +235,7 @@ acpi_run_hpp(acpi_handle handle, struct hotplug_params *hpp)
		ret_buf.pointer = kmalloc (ret_buf.length, GFP_KERNEL);
		ret_buf.pointer = kmalloc (ret_buf.length, GFP_KERNEL);
		if (!ret_buf.pointer) {
		if (!ret_buf.pointer) {
			printk(KERN_ERR "%s:%s alloc for _HPP fail\n",
			printk(KERN_ERR "%s:%s alloc for _HPP fail\n",
				__FUNCTION__, (char *)string.pointer);
				__func__, (char *)string.pointer);
			kfree(string.pointer);
			kfree(string.pointer);
			return AE_NO_MEMORY;
			return AE_NO_MEMORY;
		}
		}
@@ -245,7 +245,7 @@ acpi_run_hpp(acpi_handle handle, struct hotplug_params *hpp)
			break;
			break;
	default:
	default:
		if (ACPI_FAILURE(status)) {
		if (ACPI_FAILURE(status)) {
			pr_debug("%s:%s _HPP fail=0x%x\n", __FUNCTION__,
			pr_debug("%s:%s _HPP fail=0x%x\n", __func__,
				(char *)string.pointer, status);
				(char *)string.pointer, status);
			kfree(string.pointer);
			kfree(string.pointer);
			return status;
			return status;
@@ -254,7 +254,7 @@ acpi_run_hpp(acpi_handle handle, struct hotplug_params *hpp)


	ext_obj = (union acpi_object *) ret_buf.pointer;
	ext_obj = (union acpi_object *) ret_buf.pointer;
	if (ext_obj->type != ACPI_TYPE_PACKAGE) {
	if (ext_obj->type != ACPI_TYPE_PACKAGE) {
		printk(KERN_ERR "%s:%s _HPP obj not a package\n", __FUNCTION__,
		printk(KERN_ERR "%s:%s _HPP obj not a package\n", __func__,
				(char *)string.pointer);
				(char *)string.pointer);
		status = AE_ERROR;
		status = AE_ERROR;
		goto free_and_return;
		goto free_and_return;
@@ -270,7 +270,7 @@ acpi_run_hpp(acpi_handle handle, struct hotplug_params *hpp)
			break;
			break;
		default:
		default:
			printk(KERN_ERR "%s:%s _HPP obj type incorrect\n",
			printk(KERN_ERR "%s:%s _HPP obj type incorrect\n",
				__FUNCTION__, (char *)string.pointer);
				__func__, (char *)string.pointer);
			status = AE_ERROR;
			status = AE_ERROR;
			goto free_and_return;
			goto free_and_return;
		}
		}
@@ -311,12 +311,12 @@ acpi_status acpi_run_oshp(acpi_handle handle)
	if (ACPI_FAILURE(status))
	if (ACPI_FAILURE(status))
		if (status != AE_NOT_FOUND)
		if (status != AE_NOT_FOUND)
			printk(KERN_ERR "%s:%s OSHP fails=0x%x\n",
			printk(KERN_ERR "%s:%s OSHP fails=0x%x\n",
			       __FUNCTION__, (char *)string.pointer, status);
			       __func__, (char *)string.pointer, status);
		else
		else
			dbg("%s:%s OSHP not found\n",
			dbg("%s:%s OSHP not found\n",
			    __FUNCTION__, (char *)string.pointer);
			    __func__, (char *)string.pointer);
	else
	else
		pr_debug("%s:%s OSHP passes\n", __FUNCTION__,
		pr_debug("%s:%s OSHP passes\n", __func__,
			(char *)string.pointer);
			(char *)string.pointer);


	kfree(string.pointer);
	kfree(string.pointer);
+9 −9
Original line number Original line Diff line number Diff line
@@ -138,7 +138,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
{
{
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	/* enable the specified slot */
	/* enable the specified slot */
	return acpiphp_enable_slot(slot->acpi_slot);
	return acpiphp_enable_slot(slot->acpi_slot);
@@ -156,7 +156,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;
	int retval;
	int retval;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	/* disable the specified slot */
	/* disable the specified slot */
	retval = acpiphp_disable_slot(slot->acpi_slot);
	retval = acpiphp_disable_slot(slot->acpi_slot);
@@ -179,7 +179,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
 {
 {
	int retval = -ENODEV;
	int retval = -ENODEV;


 	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
 
 
	if (attention_info && try_module_get(attention_info->owner)) {
	if (attention_info && try_module_get(attention_info->owner)) {
		retval = attention_info->set_attn(hotplug_slot, status);
		retval = attention_info->set_attn(hotplug_slot, status);
@@ -202,7 +202,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
{
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	*value = acpiphp_get_power_status(slot->acpi_slot);
	*value = acpiphp_get_power_status(slot->acpi_slot);


@@ -224,7 +224,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
{
	int retval = -EINVAL;
	int retval = -EINVAL;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	if (attention_info && try_module_get(attention_info->owner)) {
	if (attention_info && try_module_get(attention_info->owner)) {
		retval = attention_info->get_attn(hotplug_slot, value);
		retval = attention_info->get_attn(hotplug_slot, value);
@@ -247,7 +247,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
{
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	*value = acpiphp_get_latch_status(slot->acpi_slot);
	*value = acpiphp_get_latch_status(slot->acpi_slot);


@@ -267,7 +267,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
{
{
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	*value = acpiphp_get_adapter_status(slot->acpi_slot);
	*value = acpiphp_get_adapter_status(slot->acpi_slot);


@@ -284,7 +284,7 @@ static int get_address(struct hotplug_slot *hotplug_slot, u32 *value)
{
{
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	*value = acpiphp_get_address(slot->acpi_slot);
	*value = acpiphp_get_address(slot->acpi_slot);


@@ -318,7 +318,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
{
{
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;


	dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);


	kfree(slot->hotplug_slot);
	kfree(slot->hotplug_slot);
	kfree(slot);
	kfree(slot);
+19 −19
Original line number Original line Diff line number Diff line
@@ -352,7 +352,7 @@ static void decode_hpp(struct acpiphp_bridge *bridge)
		/* use default numbers */
		/* use default numbers */
		printk(KERN_WARNING
		printk(KERN_WARNING
		       "%s: Could not get hotplug parameters. Use defaults\n",
		       "%s: Could not get hotplug parameters. Use defaults\n",
		       __FUNCTION__);
		       __func__);
		bridge->hpp.t0 = &bridge->hpp.type0_data;
		bridge->hpp.t0 = &bridge->hpp.type0_data;
		bridge->hpp.t0->revision = 0;
		bridge->hpp.t0->revision = 0;
		bridge->hpp.t0->cache_line_size = 0x10;
		bridge->hpp.t0->cache_line_size = 0x10;
@@ -534,7 +534,7 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)


	status = acpi_evaluate_integer(handle, "_ADR", NULL, &tmp);
	status = acpi_evaluate_integer(handle, "_ADR", NULL, &tmp);
	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
		dbg("%s: _ADR evaluation failure\n", __FUNCTION__);
		dbg("%s: _ADR evaluation failure\n", __func__);
		return AE_OK;
		return AE_OK;
	}
	}


@@ -578,7 +578,7 @@ static int add_bridge(acpi_handle handle)
	if (ACPI_SUCCESS(status)) {
	if (ACPI_SUCCESS(status)) {
		status = acpi_evaluate_integer(handle, "_STA", NULL, &tmp);
		status = acpi_evaluate_integer(handle, "_STA", NULL, &tmp);
		if (ACPI_FAILURE(status)) {
		if (ACPI_FAILURE(status)) {
			dbg("%s: _STA evaluation failure\n", __FUNCTION__);
			dbg("%s: _STA evaluation failure\n", __func__);
			return 0;
			return 0;
		}
		}
		if ((tmp & ACPI_STA_FUNCTIONING) == 0)
		if ((tmp & ACPI_STA_FUNCTIONING) == 0)
@@ -928,10 +928,10 @@ static int power_on_slot(struct acpiphp_slot *slot)
		func = list_entry(l, struct acpiphp_func, sibling);
		func = list_entry(l, struct acpiphp_func, sibling);


		if (func->flags & FUNC_HAS_PS0) {
		if (func->flags & FUNC_HAS_PS0) {
			dbg("%s: executing _PS0\n", __FUNCTION__);
			dbg("%s: executing _PS0\n", __func__);
			status = acpi_evaluate_object(func->handle, "_PS0", NULL, NULL);
			status = acpi_evaluate_object(func->handle, "_PS0", NULL, NULL);
			if (ACPI_FAILURE(status)) {
			if (ACPI_FAILURE(status)) {
				warn("%s: _PS0 failed\n", __FUNCTION__);
				warn("%s: _PS0 failed\n", __func__);
				retval = -1;
				retval = -1;
				goto err_exit;
				goto err_exit;
			} else
			} else
@@ -966,7 +966,7 @@ static int power_off_slot(struct acpiphp_slot *slot)
		if (func->flags & FUNC_HAS_PS3) {
		if (func->flags & FUNC_HAS_PS3) {
			status = acpi_evaluate_object(func->handle, "_PS3", NULL, NULL);
			status = acpi_evaluate_object(func->handle, "_PS3", NULL, NULL);
			if (ACPI_FAILURE(status)) {
			if (ACPI_FAILURE(status)) {
				warn("%s: _PS3 failed\n", __FUNCTION__);
				warn("%s: _PS3 failed\n", __func__);
				retval = -1;
				retval = -1;
				goto err_exit;
				goto err_exit;
			} else
			} else
@@ -1300,7 +1300,7 @@ int acpiphp_eject_slot(struct acpiphp_slot *slot)


			status = acpi_evaluate_object(func->handle, "_EJ0", &arg_list, NULL);
			status = acpi_evaluate_object(func->handle, "_EJ0", &arg_list, NULL);
			if (ACPI_FAILURE(status)) {
			if (ACPI_FAILURE(status)) {
				warn("%s: _EJ0 failed\n", __FUNCTION__);
				warn("%s: _EJ0 failed\n", __func__);
				return -1;
				return -1;
			} else
			} else
				break;
				break;
@@ -1349,7 +1349,7 @@ static int acpiphp_check_bridge(struct acpiphp_bridge *bridge)
		}
		}
	}
	}


	dbg("%s: %d enabled, %d disabled\n", __FUNCTION__, enabled, disabled);
	dbg("%s: %d enabled, %d disabled\n", __func__, enabled, disabled);


 err_exit:
 err_exit:
	return retval;
	return retval;
@@ -1527,7 +1527,7 @@ check_sub_bridges(acpi_handle handle, u32 lvl, void *context, void **rv)
	if (bridge) {
	if (bridge) {
		acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
		acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
		dbg("%s: re-enumerating slots under %s\n",
		dbg("%s: re-enumerating slots under %s\n",
			__FUNCTION__, objname);
			__func__, objname);
		acpiphp_check_bridge(bridge);
		acpiphp_check_bridge(bridge);
	}
	}
	return AE_OK ;
	return AE_OK ;
@@ -1572,10 +1572,10 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *cont
	switch (type) {
	switch (type) {
	case ACPI_NOTIFY_BUS_CHECK:
	case ACPI_NOTIFY_BUS_CHECK:
		/* bus re-enumerate */
		/* bus re-enumerate */
		dbg("%s: Bus check notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Bus check notify on %s\n", __func__, objname);
		if (bridge) {
		if (bridge) {
			dbg("%s: re-enumerating slots under %s\n",
			dbg("%s: re-enumerating slots under %s\n",
				__FUNCTION__, objname);
				__func__, objname);
			acpiphp_check_bridge(bridge);
			acpiphp_check_bridge(bridge);
		}
		}
		if (num_sub_bridges)
		if (num_sub_bridges)
@@ -1585,18 +1585,18 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, void *cont


	case ACPI_NOTIFY_DEVICE_CHECK:
	case ACPI_NOTIFY_DEVICE_CHECK:
		/* device check */
		/* device check */
		dbg("%s: Device check notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Device check notify on %s\n", __func__, objname);
		acpiphp_check_bridge(bridge);
		acpiphp_check_bridge(bridge);
		break;
		break;


	case ACPI_NOTIFY_DEVICE_WAKE:
	case ACPI_NOTIFY_DEVICE_WAKE:
		/* wake event */
		/* wake event */
		dbg("%s: Device wake notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Device wake notify on %s\n", __func__, objname);
		break;
		break;


	case ACPI_NOTIFY_EJECT_REQUEST:
	case ACPI_NOTIFY_EJECT_REQUEST:
		/* request device eject */
		/* request device eject */
		dbg("%s: Device eject notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Device eject notify on %s\n", __func__, objname);
		if ((bridge->type != BRIDGE_TYPE_HOST) &&
		if ((bridge->type != BRIDGE_TYPE_HOST) &&
		    (bridge->flags & BRIDGE_HAS_EJ0)) {
		    (bridge->flags & BRIDGE_HAS_EJ0)) {
			struct acpiphp_slot *slot;
			struct acpiphp_slot *slot;
@@ -1649,24 +1649,24 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *contex
	switch (type) {
	switch (type) {
	case ACPI_NOTIFY_BUS_CHECK:
	case ACPI_NOTIFY_BUS_CHECK:
		/* bus re-enumerate */
		/* bus re-enumerate */
		dbg("%s: Bus check notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Bus check notify on %s\n", __func__, objname);
		acpiphp_enable_slot(func->slot);
		acpiphp_enable_slot(func->slot);
		break;
		break;


	case ACPI_NOTIFY_DEVICE_CHECK:
	case ACPI_NOTIFY_DEVICE_CHECK:
		/* device check : re-enumerate from parent bus */
		/* device check : re-enumerate from parent bus */
		dbg("%s: Device check notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Device check notify on %s\n", __func__, objname);
		acpiphp_check_bridge(func->slot->bridge);
		acpiphp_check_bridge(func->slot->bridge);
		break;
		break;


	case ACPI_NOTIFY_DEVICE_WAKE:
	case ACPI_NOTIFY_DEVICE_WAKE:
		/* wake event */
		/* wake event */
		dbg("%s: Device wake notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Device wake notify on %s\n", __func__, objname);
		break;
		break;


	case ACPI_NOTIFY_EJECT_REQUEST:
	case ACPI_NOTIFY_EJECT_REQUEST:
		/* request device eject */
		/* request device eject */
		dbg("%s: Device eject notify on %s\n", __FUNCTION__, objname);
		dbg("%s: Device eject notify on %s\n", __func__, objname);
		if (!(acpiphp_disable_slot(func->slot)))
		if (!(acpiphp_disable_slot(func->slot)))
			acpiphp_eject_slot(func->slot);
			acpiphp_eject_slot(func->slot);
		break;
		break;
@@ -1796,7 +1796,7 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
		if (retval)
		if (retval)
			power_off_slot(slot);
			power_off_slot(slot);
	} else {
	} else {
		dbg("%s: Slot status is not ACPI_STA_ALL\n", __FUNCTION__);
		dbg("%s: Slot status is not ACPI_STA_ALL\n", __func__);
		power_off_slot(slot);
		power_off_slot(slot);
	}
	}


+18 −18
Original line number Original line Diff line number Diff line
@@ -186,7 +186,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)


	ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot));
	ibm_slot = ibm_slot_from_id(hpslot_to_sun(slot));


	dbg("%s: set slot %d (%d) attention status to %d\n", __FUNCTION__,
	dbg("%s: set slot %d (%d) attention status to %d\n", __func__,
			ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
			ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
			(status ? 1 : 0));
			(status ? 1 : 0));


@@ -231,7 +231,7 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status)
	else
	else
		*status = 0;
		*status = 0;


	dbg("%s: get slot %d (%d) attention status is %d\n", __FUNCTION__,
	dbg("%s: get slot %d (%d) attention status is %d\n", __func__,
			ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
			ibm_slot->slot.slot_num, ibm_slot->slot.slot_id,
			*status);
			*status);


@@ -263,10 +263,10 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
	u8 subevent = event & 0xf0;
	u8 subevent = event & 0xf0;
	struct notification *note = context;
	struct notification *note = context;


	dbg("%s: Received notification %02x\n", __FUNCTION__, event);
	dbg("%s: Received notification %02x\n", __func__, event);


	if (subevent == 0x80) {
	if (subevent == 0x80) {
		dbg("%s: generationg bus event\n", __FUNCTION__);
		dbg("%s: generationg bus event\n", __func__);
		acpi_bus_generate_proc_event(note->device, note->event, detail);
		acpi_bus_generate_proc_event(note->device, note->event, detail);
		acpi_bus_generate_netlink_event(note->device->pnp.device_class,
		acpi_bus_generate_netlink_event(note->device->pnp.device_class,
						  note->device->dev.bus_id,
						  note->device->dev.bus_id,
@@ -299,7 +299,7 @@ static int ibm_get_table_from_acpi(char **bufp)


	status = acpi_evaluate_object(ibm_acpi_handle, "APCI", NULL, &buffer);
	status = acpi_evaluate_object(ibm_acpi_handle, "APCI", NULL, &buffer);
	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
		err("%s:  APCI evaluation failed\n", __FUNCTION__);
		err("%s:  APCI evaluation failed\n", __func__);
		return -ENODEV;
		return -ENODEV;
	}
	}


@@ -307,13 +307,13 @@ static int ibm_get_table_from_acpi(char **bufp)
	if (!(package) ||
	if (!(package) ||
			(package->type != ACPI_TYPE_PACKAGE) ||
			(package->type != ACPI_TYPE_PACKAGE) ||
			!(package->package.elements)) {
			!(package->package.elements)) {
		err("%s:  Invalid APCI object\n", __FUNCTION__);
		err("%s:  Invalid APCI object\n", __func__);
		goto read_table_done;
		goto read_table_done;
	}
	}


	for(size = 0, i = 0; i < package->package.count; i++) {
	for(size = 0, i = 0; i < package->package.count; i++) {
		if (package->package.elements[i].type != ACPI_TYPE_BUFFER) {
		if (package->package.elements[i].type != ACPI_TYPE_BUFFER) {
			err("%s:  Invalid APCI element %d\n", __FUNCTION__, i);
			err("%s:  Invalid APCI element %d\n", __func__, i);
			goto read_table_done;
			goto read_table_done;
		}
		}
		size += package->package.elements[i].buffer.length;
		size += package->package.elements[i].buffer.length;
@@ -324,7 +324,7 @@ static int ibm_get_table_from_acpi(char **bufp)


	lbuf = kzalloc(size, GFP_KERNEL);
	lbuf = kzalloc(size, GFP_KERNEL);
	dbg("%s: element count: %i, ASL table size: %i, &table = 0x%p\n",
	dbg("%s: element count: %i, ASL table size: %i, &table = 0x%p\n",
			__FUNCTION__, package->package.count, size, lbuf);
			__func__, package->package.count, size, lbuf);


	if (lbuf) {
	if (lbuf) {
		*bufp = lbuf;
		*bufp = lbuf;
@@ -368,7 +368,7 @@ static ssize_t ibm_read_apci_table(struct kobject *kobj,
	int bytes_read = -EINVAL;
	int bytes_read = -EINVAL;
	char *table = NULL;
	char *table = NULL;
	
	
	dbg("%s: pos = %d, size = %zd\n", __FUNCTION__, (int)pos, size);
	dbg("%s: pos = %d, size = %zd\n", __func__, (int)pos, size);


	if (pos == 0) {
	if (pos == 0) {
		bytes_read = ibm_get_table_from_acpi(&table);
		bytes_read = ibm_get_table_from_acpi(&table);
@@ -402,7 +402,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
	status = acpi_get_object_info(handle, &info_buffer);
	status = acpi_get_object_info(handle, &info_buffer);
	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
		err("%s:  Failed to get device information status=0x%x\n",
		err("%s:  Failed to get device information status=0x%x\n",
			__FUNCTION__, status);
			__func__, status);
		return retval;
		return retval;
	}
	}
	info = info_buffer.pointer;
	info = info_buffer.pointer;
@@ -432,18 +432,18 @@ static int __init ibm_acpiphp_init(void)
	struct acpi_device *device;
	struct acpi_device *device;
	struct kobject *sysdir = &pci_hotplug_slots_kset->kobj;
	struct kobject *sysdir = &pci_hotplug_slots_kset->kobj;


	dbg("%s\n", __FUNCTION__);
	dbg("%s\n", __func__);


	if (acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
	if (acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
			ACPI_UINT32_MAX, ibm_find_acpi_device,
			ACPI_UINT32_MAX, ibm_find_acpi_device,
			&ibm_acpi_handle, NULL) != FOUND_APCI) {
			&ibm_acpi_handle, NULL) != FOUND_APCI) {
		err("%s: acpi_walk_namespace failed\n", __FUNCTION__);
		err("%s: acpi_walk_namespace failed\n", __func__);
		retval = -ENODEV;
		retval = -ENODEV;
		goto init_return;
		goto init_return;
	}
	}
	dbg("%s: found IBM aPCI device\n", __FUNCTION__);
	dbg("%s: found IBM aPCI device\n", __func__);
	if (acpi_bus_get_device(ibm_acpi_handle, &device)) {
	if (acpi_bus_get_device(ibm_acpi_handle, &device)) {
		err("%s: acpi_bus_get_device failed\n", __FUNCTION__);
		err("%s: acpi_bus_get_device failed\n", __func__);
		retval = -ENODEV;
		retval = -ENODEV;
		goto init_return;
		goto init_return;
	}
	}
@@ -458,7 +458,7 @@ static int __init ibm_acpiphp_init(void)
			&ibm_note);
			&ibm_note);
	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
		err("%s: Failed to register notification handler\n",
		err("%s: Failed to register notification handler\n",
				__FUNCTION__);
				__func__);
		retval = -EBUSY;
		retval = -EBUSY;
		goto init_cleanup;
		goto init_cleanup;
	}
	}
@@ -479,17 +479,17 @@ static void __exit ibm_acpiphp_exit(void)
	acpi_status status;
	acpi_status status;
	struct kobject *sysdir = &pci_hotplug_slots_kset->kobj;
	struct kobject *sysdir = &pci_hotplug_slots_kset->kobj;


	dbg("%s\n", __FUNCTION__);
	dbg("%s\n", __func__);


	if (acpiphp_unregister_attention(&ibm_attention_info))
	if (acpiphp_unregister_attention(&ibm_attention_info))
		err("%s: attention info deregistration failed", __FUNCTION__);
		err("%s: attention info deregistration failed", __func__);


	status = acpi_remove_notify_handler(
	status = acpi_remove_notify_handler(
			   ibm_acpi_handle,
			   ibm_acpi_handle,
			   ACPI_DEVICE_NOTIFY,
			   ACPI_DEVICE_NOTIFY,
			   ibm_handle_events);
			   ibm_handle_events);
	if (ACPI_FAILURE(status))
	if (ACPI_FAILURE(status))
		err("%s: Notification handler removal failed\n", __FUNCTION__);
		err("%s: Notification handler removal failed\n", __func__);
	/* remove the /sys entries */
	/* remove the /sys entries */
	sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr);
	sysfs_remove_bin_file(sysdir, &ibm_apci_table_attr);
}
}
+30 −30
Original line number Original line Diff line number Diff line
@@ -108,7 +108,7 @@ enable_slot(struct hotplug_slot *hotplug_slot)
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;
	int retval = 0;
	int retval = 0;


	dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s", __func__, hotplug_slot->name);


	if (controller->ops->set_power)
	if (controller->ops->set_power)
		retval = controller->ops->set_power(slot, 1);
		retval = controller->ops->set_power(slot, 1);
@@ -121,25 +121,25 @@ disable_slot(struct hotplug_slot *hotplug_slot)
	struct slot *slot = hotplug_slot->private;
	struct slot *slot = hotplug_slot->private;
	int retval = 0;
	int retval = 0;


	dbg("%s - physical_slot = %s", __FUNCTION__, hotplug_slot->name);
	dbg("%s - physical_slot = %s", __func__, hotplug_slot->name);


	down_write(&list_rwsem);
	down_write(&list_rwsem);


	/* Unconfigure device */
	/* Unconfigure device */
	dbg("%s - unconfiguring slot %s",
	dbg("%s - unconfiguring slot %s",
	    __FUNCTION__, slot->hotplug_slot->name);
	    __func__, slot->hotplug_slot->name);
	if ((retval = cpci_unconfigure_slot(slot))) {
	if ((retval = cpci_unconfigure_slot(slot))) {
		err("%s - could not unconfigure slot %s",
		err("%s - could not unconfigure slot %s",
		    __FUNCTION__, slot->hotplug_slot->name);
		    __func__, slot->hotplug_slot->name);
		goto disable_error;
		goto disable_error;
	}
	}
	dbg("%s - finished unconfiguring slot %s",
	dbg("%s - finished unconfiguring slot %s",
	    __FUNCTION__, slot->hotplug_slot->name);
	    __func__, slot->hotplug_slot->name);


	/* Clear EXT (by setting it) */
	/* Clear EXT (by setting it) */
	if (cpci_clear_ext(slot)) {
	if (cpci_clear_ext(slot)) {
		err("%s - could not clear EXT for slot %s",
		err("%s - could not clear EXT for slot %s",
		    __FUNCTION__, slot->hotplug_slot->name);
		    __func__, slot->hotplug_slot->name);
		retval = -ENODEV;
		retval = -ENODEV;
		goto disable_error;
		goto disable_error;
	}
	}
@@ -372,7 +372,7 @@ init_slots(int clear_ins)
	struct slot *slot;
	struct slot *slot;
	struct pci_dev* dev;
	struct pci_dev* dev;


	dbg("%s - enter", __FUNCTION__);
	dbg("%s - enter", __func__);
	down_read(&list_rwsem);
	down_read(&list_rwsem);
	if (!slots) {
	if (!slots) {
		up_read(&list_rwsem);
		up_read(&list_rwsem);
@@ -380,10 +380,10 @@ init_slots(int clear_ins)
	}
	}
	list_for_each_entry(slot, &slot_list, slot_list) {
	list_for_each_entry(slot, &slot_list, slot_list) {
		dbg("%s - looking at slot %s",
		dbg("%s - looking at slot %s",
		    __FUNCTION__, slot->hotplug_slot->name);
		    __func__, slot->hotplug_slot->name);
		if (clear_ins && cpci_check_and_clear_ins(slot))
		if (clear_ins && cpci_check_and_clear_ins(slot))
			dbg("%s - cleared INS for slot %s",
			dbg("%s - cleared INS for slot %s",
			    __FUNCTION__, slot->hotplug_slot->name);
			    __func__, slot->hotplug_slot->name);
		dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0));
		dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0));
		if (dev) {
		if (dev) {
			if (update_adapter_status(slot->hotplug_slot, 1))
			if (update_adapter_status(slot->hotplug_slot, 1))
@@ -394,7 +394,7 @@ init_slots(int clear_ins)
		}
		}
	}
	}
	up_read(&list_rwsem);
	up_read(&list_rwsem);
	dbg("%s - exit", __FUNCTION__);
	dbg("%s - exit", __func__);
	return 0;
	return 0;
}
}


@@ -415,7 +415,7 @@ check_slots(void)
	extracted = inserted = 0;
	extracted = inserted = 0;
	list_for_each_entry(slot, &slot_list, slot_list) {
	list_for_each_entry(slot, &slot_list, slot_list) {
		dbg("%s - looking at slot %s",
		dbg("%s - looking at slot %s",
		    __FUNCTION__, slot->hotplug_slot->name);
		    __func__, slot->hotplug_slot->name);
		if (cpci_check_and_clear_ins(slot)) {
		if (cpci_check_and_clear_ins(slot)) {
			/*
			/*
			 * Some broken hardware (e.g. PLX 9054AB) asserts
			 * Some broken hardware (e.g. PLX 9054AB) asserts
@@ -430,28 +430,28 @@ check_slots(void)


			/* Process insertion */
			/* Process insertion */
			dbg("%s - slot %s inserted",
			dbg("%s - slot %s inserted",
			    __FUNCTION__, slot->hotplug_slot->name);
			    __func__, slot->hotplug_slot->name);


			/* GSM, debug */
			/* GSM, debug */
			hs_csr = cpci_get_hs_csr(slot);
			hs_csr = cpci_get_hs_csr(slot);
			dbg("%s - slot %s HS_CSR (1) = %04x",
			dbg("%s - slot %s HS_CSR (1) = %04x",
			    __FUNCTION__, slot->hotplug_slot->name, hs_csr);
			    __func__, slot->hotplug_slot->name, hs_csr);


			/* Configure device */
			/* Configure device */
			dbg("%s - configuring slot %s",
			dbg("%s - configuring slot %s",
			    __FUNCTION__, slot->hotplug_slot->name);
			    __func__, slot->hotplug_slot->name);
			if (cpci_configure_slot(slot)) {
			if (cpci_configure_slot(slot)) {
				err("%s - could not configure slot %s",
				err("%s - could not configure slot %s",
				    __FUNCTION__, slot->hotplug_slot->name);
				    __func__, slot->hotplug_slot->name);
				continue;
				continue;
			}
			}
			dbg("%s - finished configuring slot %s",
			dbg("%s - finished configuring slot %s",
			    __FUNCTION__, slot->hotplug_slot->name);
			    __func__, slot->hotplug_slot->name);


			/* GSM, debug */
			/* GSM, debug */
			hs_csr = cpci_get_hs_csr(slot);
			hs_csr = cpci_get_hs_csr(slot);
			dbg("%s - slot %s HS_CSR (2) = %04x",
			dbg("%s - slot %s HS_CSR (2) = %04x",
			    __FUNCTION__, slot->hotplug_slot->name, hs_csr);
			    __func__, slot->hotplug_slot->name, hs_csr);


			if (update_latch_status(slot->hotplug_slot, 1))
			if (update_latch_status(slot->hotplug_slot, 1))
				warn("failure to update latch file");
				warn("failure to update latch file");
@@ -464,18 +464,18 @@ check_slots(void)
			/* GSM, debug */
			/* GSM, debug */
			hs_csr = cpci_get_hs_csr(slot);
			hs_csr = cpci_get_hs_csr(slot);
			dbg("%s - slot %s HS_CSR (3) = %04x",
			dbg("%s - slot %s HS_CSR (3) = %04x",
			    __FUNCTION__, slot->hotplug_slot->name, hs_csr);
			    __func__, slot->hotplug_slot->name, hs_csr);


			inserted++;
			inserted++;
		} else if (cpci_check_ext(slot)) {
		} else if (cpci_check_ext(slot)) {
			/* Process extraction request */
			/* Process extraction request */
			dbg("%s - slot %s extracted",
			dbg("%s - slot %s extracted",
			    __FUNCTION__, slot->hotplug_slot->name);
			    __func__, slot->hotplug_slot->name);


			/* GSM, debug */
			/* GSM, debug */
			hs_csr = cpci_get_hs_csr(slot);
			hs_csr = cpci_get_hs_csr(slot);
			dbg("%s - slot %s HS_CSR = %04x",
			dbg("%s - slot %s HS_CSR = %04x",
			    __FUNCTION__, slot->hotplug_slot->name, hs_csr);
			    __func__, slot->hotplug_slot->name, hs_csr);


			if (!slot->extracting) {
			if (!slot->extracting) {
				if (update_latch_status(slot->hotplug_slot, 0)) {
				if (update_latch_status(slot->hotplug_slot, 0)) {
@@ -519,7 +519,7 @@ event_thread(void *data)
{
{
	int rc;
	int rc;


	dbg("%s - event thread started", __FUNCTION__);
	dbg("%s - event thread started", __func__);
	while (1) {
	while (1) {
		dbg("event thread sleeping");
		dbg("event thread sleeping");
		set_current_state(TASK_INTERRUPTIBLE);
		set_current_state(TASK_INTERRUPTIBLE);
@@ -532,7 +532,7 @@ event_thread(void *data)
				/* Give userspace a chance to handle extraction */
				/* Give userspace a chance to handle extraction */
				msleep(500);
				msleep(500);
			} else if (rc < 0) {
			} else if (rc < 0) {
				dbg("%s - error checking slots", __FUNCTION__);
				dbg("%s - error checking slots", __func__);
				thread_finished = 1;
				thread_finished = 1;
				goto out;
				goto out;
			}
			}
@@ -541,7 +541,7 @@ event_thread(void *data)
			break;
			break;


		/* Re-enable ENUM# interrupt */
		/* Re-enable ENUM# interrupt */
		dbg("%s - re-enabling irq", __FUNCTION__);
		dbg("%s - re-enabling irq", __func__);
		controller->ops->enable_irq();
		controller->ops->enable_irq();
	}
	}
 out:
 out:
@@ -564,7 +564,7 @@ poll_thread(void *data)
					/* Give userspace a chance to handle extraction */
					/* Give userspace a chance to handle extraction */
					msleep(500);
					msleep(500);
				} else if (rc < 0) {
				} else if (rc < 0) {
					dbg("%s - error checking slots", __FUNCTION__);
					dbg("%s - error checking slots", __func__);
					thread_finished = 1;
					thread_finished = 1;
					goto out;
					goto out;
				}
				}
@@ -621,7 +621,7 @@ cpci_hp_register_controller(struct cpci_hp_controller *new_controller)
			status = -ENODEV;
			status = -ENODEV;
		}
		}
		dbg("%s - acquired controller irq %d",
		dbg("%s - acquired controller irq %d",
		    __FUNCTION__, new_controller->irq);
		    __func__, new_controller->irq);
	}
	}
	if (!status)
	if (!status)
		controller = new_controller;
		controller = new_controller;
@@ -673,7 +673,7 @@ cpci_hp_start(void)
	static int first = 1;
	static int first = 1;
	int status;
	int status;


	dbg("%s - enter", __FUNCTION__);
	dbg("%s - enter", __func__);
	if (!controller)
	if (!controller)
		return -ENODEV;
		return -ENODEV;


@@ -693,14 +693,14 @@ cpci_hp_start(void)
	status = cpci_start_thread();
	status = cpci_start_thread();
	if (status)
	if (status)
		return status;
		return status;
	dbg("%s - thread started", __FUNCTION__);
	dbg("%s - thread started", __func__);


	if (controller->irq) {
	if (controller->irq) {
		/* Start enum interrupt processing */
		/* Start enum interrupt processing */
		dbg("%s - enabling irq", __FUNCTION__);
		dbg("%s - enabling irq", __func__);
		controller->ops->enable_irq();
		controller->ops->enable_irq();
	}
	}
	dbg("%s - exit", __FUNCTION__);
	dbg("%s - exit", __func__);
	return 0;
	return 0;
}
}


@@ -711,7 +711,7 @@ cpci_hp_stop(void)
		return -ENODEV;
		return -ENODEV;
	if (controller->irq) {
	if (controller->irq) {
		/* Stop enum interrupt processing */
		/* Stop enum interrupt processing */
		dbg("%s - disabling irq", __FUNCTION__);
		dbg("%s - disabling irq", __func__);
		controller->ops->disable_irq();
		controller->ops->disable_irq();
	}
	}
	cpci_stop_thread();
	cpci_stop_thread();
Loading