* [PATCH 01/11] arch/ia64/hp/common/sba_iommu.c: Rename dev_info to adi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-05 19:05 ` [PATCH 02/11] drivers/usb/host/hwa-hc.c: Rename dev_info to hdi Joe Perches
` (9 subsequent siblings)
10 siblings, 0 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: Tony Luck, Fenghua Yu, linux-ia64, linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/ia64/hp/common/sba_iommu.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index e14c492..4ce8d13 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -2046,13 +2046,13 @@ acpi_sba_ioc_add(struct acpi_device *device)
struct ioc *ioc;
acpi_status status;
u64 hpa, length;
- struct acpi_device_info *dev_info;
+ struct acpi_device_info *adi;
status = hp_acpi_csr_space(device->handle, &hpa, &length);
if (ACPI_FAILURE(status))
return 1;
- status = acpi_get_object_info(device->handle, &dev_info);
+ status = acpi_get_object_info(device->handle, &adi);
if (ACPI_FAILURE(status))
return 1;
@@ -2060,13 +2060,13 @@ acpi_sba_ioc_add(struct acpi_device *device)
* For HWP0001, only SBA appears in ACPI namespace. It encloses the PCI
* root bridges, and its CSR space includes the IOC function.
*/
- if (strncmp("HWP0001", dev_info->hardware_id.string, 7) == 0) {
+ if (strncmp("HWP0001", adi->hardware_id.string, 7) == 0) {
hpa += ZX1_IOC_OFFSET;
/* zx1 based systems default to kernel page size iommu pages */
if (!iovp_shift)
iovp_shift = min(PAGE_SHIFT, 16);
}
- kfree(dev_info);
+ kfree(adi);
/*
* default anything not caught above or specified on cmdline to 4k
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* [PATCH 02/11] drivers/usb/host/hwa-hc.c: Rename dev_info to hdi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
2010-04-05 19:05 ` [PATCH 01/11] arch/ia64/hp/common/sba_iommu.c: Rename dev_info to adi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-06 12:28 ` David Vrabel
2010-04-05 19:05 ` [PATCH 03/11] drivers/usb/wusbcore/wusbhc.h: Remove unused dev_info from struct wusb_port Joe Perches
` (8 subsequent siblings)
10 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Vrabel, Greg Kroah-Hartman, linux-usb, linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/usb/host/hwa-hc.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c
index 88b0321..5366ab1 100644
--- a/drivers/usb/host/hwa-hc.c
+++ b/drivers/usb/host/hwa-hc.c
@@ -375,16 +375,16 @@ static int __hwahc_op_dev_info_set(struct wusbhc *wusbhc,
struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc);
struct wahc *wa = &hwahc->wa;
u8 iface_no = wa->usb_iface->cur_altsetting->desc.bInterfaceNumber;
- struct hwa_dev_info *dev_info;
+ struct hwa_dev_info *hdi;
int ret;
/* fill out the Device Info buffer and send it */
- dev_info = kzalloc(sizeof(struct hwa_dev_info), GFP_KERNEL);
- if (!dev_info)
+ hdi = kzalloc(sizeof(struct hwa_dev_info), GFP_KERNEL);
+ if (!hdi)
return -ENOMEM;
- uwb_mas_bm_copy_le(dev_info->bmDeviceAvailability,
+ uwb_mas_bm_copy_le(hdi->bmDeviceAvailability,
&wusb_dev->availability);
- dev_info->bDeviceAddress = wusb_dev->addr;
+ hdi->bDeviceAddress = wusb_dev->addr;
/*
* If the descriptors haven't been read yet, use a default PHY
@@ -394,17 +394,17 @@ static int __hwahc_op_dev_info_set(struct wusbhc *wusbhc,
* have been read).
*/
if (wusb_dev->wusb_cap_descr)
- dev_info->wPHYRates = wusb_dev->wusb_cap_descr->wPHYRates;
+ hdi->wPHYRates = wusb_dev->wusb_cap_descr->wPHYRates;
else
- dev_info->wPHYRates = cpu_to_le16(USB_WIRELESS_PHY_53);
+ hdi->wPHYRates = cpu_to_le16(USB_WIRELESS_PHY_53);
ret = usb_control_msg(wa->usb_dev, usb_sndctrlpipe(wa->usb_dev, 0),
WUSB_REQ_SET_DEV_INFO,
USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
0, wusb_dev->port_idx << 8 | iface_no,
- dev_info, sizeof(struct hwa_dev_info),
+ hdi, sizeof(struct hwa_dev_info),
1000 /* FIXME: arbitrary */);
- kfree(dev_info);
+ kfree(hdi);
return ret;
}
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 02/11] drivers/usb/host/hwa-hc.c: Rename dev_info to hdi
2010-04-05 19:05 ` [PATCH 02/11] drivers/usb/host/hwa-hc.c: Rename dev_info to hdi Joe Perches
@ 2010-04-06 12:28 ` David Vrabel
0 siblings, 0 replies; 28+ messages in thread
From: David Vrabel @ 2010-04-06 12:28 UTC (permalink / raw)
To: Joe Perches; +Cc: Andrew Morton, Greg Kroah-Hartman, linux-usb, linux-kernel
Joe Perches wrote:
> There is a macro called dev_info that prints struct device specific
> information. Having variables with the same name can be confusing and
> prevents conversion of the macro to a function.
>
> Rename the existing dev_info variables to something else in preparation
> to converting the dev_info macro to a function.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: David Vrabel <david.vrabel@csr.com>
David
--
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 03/11] drivers/usb/wusbcore/wusbhc.h: Remove unused dev_info from struct wusb_port
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
2010-04-05 19:05 ` [PATCH 01/11] arch/ia64/hp/common/sba_iommu.c: Rename dev_info to adi Joe Perches
2010-04-05 19:05 ` [PATCH 02/11] drivers/usb/host/hwa-hc.c: Rename dev_info to hdi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-06 9:39 ` Sergei Shtylyov
2010-04-06 12:44 ` David Vrabel
2010-04-05 19:05 ` [PATCH 04/11] drivers/s390/block/dcssblk.c: Rename dev_info to ddi Joe Perches
` (7 subsequent siblings)
10 siblings, 2 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Vrabel, Greg Kroah-Hartman, linux-usb, linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/usb/wusbcore/wusbhc.h | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/wusbcore/wusbhc.h b/drivers/usb/wusbcore/wusbhc.h
index 759cda5..dffda29 100644
--- a/drivers/usb/wusbcore/wusbhc.h
+++ b/drivers/usb/wusbcore/wusbhc.h
@@ -185,15 +185,6 @@ struct wusb_port {
*
* Read/Write protected by @mutex
*
- * @dev_info This array has ports_max elements. It is used to
- * give the HC information about the WUSB devices (see
- * 'struct wusb_dev_info').
- *
- * For HWA we need to allocate it in heap; for WHCI it
- * needs to be permanently mapped, so we keep it for
- * both and make it easy. Call wusbhc->dev_info_set()
- * to update an entry.
- *
* @ports_max Number of simultaneous device connections (fake
* ports) this HC will take. Read-only.
*
@@ -259,7 +250,6 @@ struct wusbhc {
struct mutex mutex; /* locks everything else */
u16 cluster_id; /* Wireless USB Cluster ID */
struct wusb_port *port; /* Fake port status handling */
- struct wusb_dev_info *dev_info; /* for Set Device Info mgmt */
u8 ports_max;
unsigned active:1; /* currently xmit'ing MMCs */
struct wuie_keep_alive keep_alive_ie; /* protected by mutex */
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 03/11] drivers/usb/wusbcore/wusbhc.h: Remove unused dev_info from struct wusb_port
2010-04-05 19:05 ` [PATCH 03/11] drivers/usb/wusbcore/wusbhc.h: Remove unused dev_info from struct wusb_port Joe Perches
@ 2010-04-06 9:39 ` Sergei Shtylyov
2010-04-06 12:44 ` David Vrabel
1 sibling, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2010-04-06 9:39 UTC (permalink / raw)
To: Joe Perches
Cc: Andrew Morton, David Vrabel, Greg Kroah-Hartman, linux-usb,
linux-kernel
Hello.
Joe Perches wrote:
> There is a macro called dev_info that prints struct device specific
> information. Having variables with the same name can be confusing and
> prevents conversion of the macro to a function.
>
> Rename the existing dev_info variables to something else in preparation
> to converting the dev_info macro to a function.
>
You're not renaming the variable in this case, you're removing a field.
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/usb/wusbcore/wusbhc.h | 10 ----------
> 1 files changed, 0 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/usb/wusbcore/wusbhc.h b/drivers/usb/wusbcore/wusbhc.h
> index 759cda5..dffda29 100644
> --- a/drivers/usb/wusbcore/wusbhc.h
> +++ b/drivers/usb/wusbcore/wusbhc.h
> @@ -185,15 +185,6 @@ struct wusb_port {
> *
> * Read/Write protected by @mutex
> *
> - * @dev_info This array has ports_max elements. It is used to
> - * give the HC information about the WUSB devices (see
> - * 'struct wusb_dev_info').
> - *
> - * For HWA we need to allocate it in heap; for WHCI it
> - * needs to be permanently mapped, so we keep it for
> - * both and make it easy. Call wusbhc->dev_info_set()
> - * to update an entry.
> - *
> * @ports_max Number of simultaneous device connections (fake
> * ports) this HC will take. Read-only.
> *
> @@ -259,7 +250,6 @@ struct wusbhc {
> struct mutex mutex; /* locks everything else */
> u16 cluster_id; /* Wireless USB Cluster ID */
> struct wusb_port *port; /* Fake port status handling */
> - struct wusb_dev_info *dev_info; /* for Set Device Info mgmt */
> u8 ports_max;
> unsigned active:1; /* currently xmit'ing MMCs */
> struct wuie_keep_alive keep_alive_ie; /* protected by mutex */
>
WBR, Sergei
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [PATCH 03/11] drivers/usb/wusbcore/wusbhc.h: Remove unused dev_info from struct wusb_port
2010-04-05 19:05 ` [PATCH 03/11] drivers/usb/wusbcore/wusbhc.h: Remove unused dev_info from struct wusb_port Joe Perches
2010-04-06 9:39 ` Sergei Shtylyov
@ 2010-04-06 12:44 ` David Vrabel
1 sibling, 0 replies; 28+ messages in thread
From: David Vrabel @ 2010-04-06 12:44 UTC (permalink / raw)
To: Joe Perches; +Cc: Andrew Morton, Greg Kroah-Hartman, linux-usb, linux-kernel
Joe Perches wrote:
> There is a macro called dev_info that prints struct device specific
> information. Having variables with the same name can be confusing and
> prevents conversion of the macro to a function.
>
> Rename the existing dev_info variables to something else in preparation
> to converting the dev_info macro to a function.
>
> Signed-off-by: Joe Perches <joe@perches.com>
This commit message isn't strictly correct but otherwise,
Acked-by: David Vrabel <david.vrabel@csr.com>
Not sure what this field was ever for...
David
--
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 04/11] drivers/s390/block/dcssblk.c: Rename dev_info to ddi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (2 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 03/11] drivers/usb/wusbcore/wusbhc.h: Remove unused dev_info from struct wusb_port Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-05 19:05 ` [PATCH 05/11] drivers/edac/amd: Rename dev_info to adi Joe Perches
` (6 subsequent siblings)
10 siblings, 0 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton
Cc: Martin Schwidefsky, Heiko Carstens, linux390, linux-s390,
linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/s390/block/dcssblk.c | 328 +++++++++++++++++++++---------------------
1 files changed, 164 insertions(+), 164 deletions(-)
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 9b43ae9..46003b9 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -98,15 +98,15 @@ static struct rw_semaphore dcssblk_devices_sem;
static void
dcssblk_release_segment(struct device *dev)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *entry, *temp;
- dev_info = container_of(dev, struct dcssblk_dev_info, dev);
- list_for_each_entry_safe(entry, temp, &dev_info->seg_list, lh) {
+ ddi = container_of(dev, struct dcssblk_dev_info, dev);
+ list_for_each_entry_safe(entry, temp, &ddi->seg_list, lh) {
list_del(&entry->lh);
kfree(entry);
}
- kfree(dev_info);
+ kfree(ddi);
module_put(THIS_MODULE);
}
@@ -117,12 +117,12 @@ dcssblk_release_segment(struct device *dev)
* freed.
*/
static int
-dcssblk_assign_free_minor(struct dcssblk_dev_info *dev_info)
+dcssblk_assign_free_minor(struct dcssblk_dev_info *ddi)
{
int minor, found;
struct dcssblk_dev_info *entry;
- if (dev_info == NULL)
+ if (ddi == NULL)
return -EINVAL;
for (minor = 0; minor < (1<<MINORBITS); minor++) {
found = 0;
@@ -134,7 +134,7 @@ dcssblk_assign_free_minor(struct dcssblk_dev_info *dev_info)
}
if (found)
return -EBUSY;
- dev_info->gd->first_minor = minor;
+ ddi->gd->first_minor = minor;
return 0;
}
@@ -164,11 +164,11 @@ dcssblk_get_device_by_name(char *name)
static struct segment_info *
dcssblk_get_segment_by_name(char *name)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *entry;
- list_for_each_entry(dev_info, &dcssblk_devices, lh) {
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(ddi, &dcssblk_devices, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
if (!strcmp(name, entry->segment_name))
return entry;
}
@@ -180,13 +180,13 @@ dcssblk_get_segment_by_name(char *name)
* get the highest address of the multi-segment block.
*/
static unsigned long
-dcssblk_find_highest_addr(struct dcssblk_dev_info *dev_info)
+dcssblk_find_highest_addr(struct dcssblk_dev_info *ddi)
{
unsigned long highest_addr;
struct segment_info *entry;
highest_addr = 0;
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
if (highest_addr < entry->end)
highest_addr = entry->end;
}
@@ -197,7 +197,7 @@ dcssblk_find_highest_addr(struct dcssblk_dev_info *dev_info)
* get the lowest address of the multi-segment block.
*/
static unsigned long
-dcssblk_find_lowest_addr(struct dcssblk_dev_info *dev_info)
+dcssblk_find_lowest_addr(struct dcssblk_dev_info *ddi)
{
int set_first;
unsigned long lowest_addr;
@@ -205,7 +205,7 @@ dcssblk_find_lowest_addr(struct dcssblk_dev_info *dev_info)
set_first = 0;
lowest_addr = 0;
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
if (set_first == 0) {
lowest_addr = entry->start;
set_first = 1;
@@ -221,28 +221,28 @@ dcssblk_find_lowest_addr(struct dcssblk_dev_info *dev_info)
* Check continuity of segments.
*/
static int
-dcssblk_is_continuous(struct dcssblk_dev_info *dev_info)
+dcssblk_is_continuous(struct dcssblk_dev_info *ddi)
{
int i, j, rc;
struct segment_info *sort_list, *entry, temp;
- if (dev_info->num_of_segments <= 1)
+ if (ddi->num_of_segments <= 1)
return 0;
sort_list = kzalloc(
- sizeof(struct segment_info) * dev_info->num_of_segments,
+ sizeof(struct segment_info) * ddi->num_of_segments,
GFP_KERNEL);
if (sort_list == NULL)
return -ENOMEM;
i = 0;
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
memcpy(&sort_list[i], entry, sizeof(struct segment_info));
i++;
}
/* sort segments */
- for (i = 0; i < dev_info->num_of_segments; i++)
- for (j = 0; j < dev_info->num_of_segments; j++)
+ for (i = 0; i < ddi->num_of_segments; i++)
+ for (j = 0; j < ddi->num_of_segments; j++)
if (sort_list[j].start > sort_list[i].start) {
memcpy(&temp, &sort_list[i],
sizeof(struct segment_info));
@@ -253,7 +253,7 @@ dcssblk_is_continuous(struct dcssblk_dev_info *dev_info)
}
/* check continuity */
- for (i = 0; i < dev_info->num_of_segments - 1; i++) {
+ for (i = 0; i < ddi->num_of_segments - 1; i++) {
if ((sort_list[i].end + 1) != sort_list[i+1].start) {
pr_err("Adjacent DCSSs %s and %s are not "
"contiguous\n", sort_list[i].segment_name,
@@ -331,30 +331,30 @@ static void dcssblk_unregister_callback(struct device *dev)
static ssize_t
dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
- dev_info = container_of(dev, struct dcssblk_dev_info, dev);
- return sprintf(buf, dev_info->is_shared ? "1\n" : "0\n");
+ ddi = container_of(dev, struct dcssblk_dev_info, dev);
+ return sprintf(buf, ddi->is_shared ? "1\n" : "0\n");
}
static ssize_t
dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *entry, *temp;
int rc;
if ((count > 1) && (inbuf[1] != '\n') && (inbuf[1] != '\0'))
return -EINVAL;
down_write(&dcssblk_devices_sem);
- dev_info = container_of(dev, struct dcssblk_dev_info, dev);
- if (atomic_read(&dev_info->use_count)) {
+ ddi = container_of(dev, struct dcssblk_dev_info, dev);
+ if (atomic_read(&ddi->use_count)) {
rc = -EBUSY;
goto out;
}
if (inbuf[0] == '1') {
/* reload segments in shared mode */
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
rc = segment_modify_shared(entry->segment_name,
SEGMENT_SHARED);
if (rc < 0) {
@@ -363,23 +363,23 @@ dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const ch
goto removeseg;
}
}
- dev_info->is_shared = 1;
- switch (dev_info->segment_type) {
+ ddi->is_shared = 1;
+ switch (ddi->segment_type) {
case SEG_TYPE_SR:
case SEG_TYPE_ER:
case SEG_TYPE_SC:
- set_disk_ro(dev_info->gd, 1);
+ set_disk_ro(ddi->gd, 1);
}
} else if (inbuf[0] == '0') {
/* reload segments in exclusive mode */
- if (dev_info->segment_type == SEG_TYPE_SC) {
+ if (ddi->segment_type == SEG_TYPE_SC) {
pr_err("DCSS %s is of type SC and cannot be "
"loaded as exclusive-writable\n",
- dev_info->segment_name);
+ ddi->segment_name);
rc = -EINVAL;
goto out;
}
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
rc = segment_modify_shared(entry->segment_name,
SEGMENT_EXCLUSIVE);
if (rc < 0) {
@@ -388,8 +388,8 @@ dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const ch
goto removeseg;
}
}
- dev_info->is_shared = 0;
- set_disk_ro(dev_info->gd, 0);
+ ddi->is_shared = 0;
+ set_disk_ro(ddi->gd, 0);
} else {
rc = -EINVAL;
goto out;
@@ -399,18 +399,18 @@ dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const ch
removeseg:
pr_err("DCSS device %s is removed after a failed access mode "
- "change\n", dev_info->segment_name);
+ "change\n", ddi->segment_name);
temp = entry;
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
if (entry != temp)
segment_unload(entry->segment_name);
}
- list_del(&dev_info->lh);
+ list_del(&ddi->lh);
- del_gendisk(dev_info->gd);
- blk_cleanup_queue(dev_info->dcssblk_queue);
- dev_info->gd->queue = NULL;
- put_disk(dev_info->gd);
+ del_gendisk(ddi->gd);
+ blk_cleanup_queue(ddi->dcssblk_queue);
+ ddi->gd->queue = NULL;
+ put_disk(ddi->gd);
rc = device_schedule_callback(dev, dcssblk_unregister_callback);
out:
up_write(&dcssblk_devices_sem);
@@ -427,29 +427,29 @@ out:
static ssize_t
dcssblk_save_show(struct device *dev, struct device_attribute *attr, char *buf)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
- dev_info = container_of(dev, struct dcssblk_dev_info, dev);
- return sprintf(buf, dev_info->save_pending ? "1\n" : "0\n");
+ ddi = container_of(dev, struct dcssblk_dev_info, dev);
+ return sprintf(buf, ddi->save_pending ? "1\n" : "0\n");
}
static ssize_t
dcssblk_save_store(struct device *dev, struct device_attribute *attr, const char *inbuf, size_t count)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *entry;
if ((count > 1) && (inbuf[1] != '\n') && (inbuf[1] != '\0'))
return -EINVAL;
- dev_info = container_of(dev, struct dcssblk_dev_info, dev);
+ ddi = container_of(dev, struct dcssblk_dev_info, dev);
down_write(&dcssblk_devices_sem);
if (inbuf[0] == '1') {
- if (atomic_read(&dev_info->use_count) == 0) {
+ if (atomic_read(&ddi->use_count) == 0) {
// device is idle => we save immediately
pr_info("All DCSSs that map to device %s are "
- "saved\n", dev_info->segment_name);
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ "saved\n", ddi->segment_name);
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
segment_save(entry->segment_name);
}
} else {
@@ -457,17 +457,17 @@ dcssblk_save_store(struct device *dev, struct device_attribute *attr, const char
// idle in dcssblk_release
pr_info("Device %s is in use, its DCSSs will be "
"saved when it becomes idle\n",
- dev_info->segment_name);
- dev_info->save_pending = 1;
+ ddi->segment_name);
+ ddi->save_pending = 1;
}
} else if (inbuf[0] == '0') {
- if (dev_info->save_pending) {
+ if (ddi->save_pending) {
// device is busy & the user wants to undo his save
// request
- dev_info->save_pending = 0;
+ ddi->save_pending = 0;
pr_info("A pending save request for device %s "
"has been canceled\n",
- dev_info->segment_name);
+ ddi->segment_name);
}
} else {
up_write(&dcssblk_devices_sem);
@@ -486,14 +486,14 @@ dcssblk_seglist_show(struct device *dev, struct device_attribute *attr,
{
int i;
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *entry;
down_read(&dcssblk_devices_sem);
- dev_info = container_of(dev, struct dcssblk_dev_info, dev);
+ ddi = container_of(dev, struct dcssblk_dev_info, dev);
i = 0;
buf[0] = '\0';
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
strcpy(&buf[i], entry->segment_name);
i += strlen(entry->segment_name);
buf[i] = '\n';
@@ -510,12 +510,12 @@ static ssize_t
dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
int rc, i, j, num_of_segments;
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *seg_info, *temp;
char *local_buf;
unsigned long seg_byte_size;
- dev_info = NULL;
+ ddi = NULL;
seg_info = NULL;
if (dev != dcssblk_root_dev) {
rc = -EINVAL;
@@ -556,17 +556,17 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
* get a struct dcssblk_dev_info
*/
if (num_of_segments == 0) {
- dev_info = kzalloc(sizeof(struct dcssblk_dev_info),
+ ddi = kzalloc(sizeof(struct dcssblk_dev_info),
GFP_KERNEL);
- if (dev_info == NULL) {
+ if (ddi == NULL) {
rc = -ENOMEM;
goto out;
}
- strcpy(dev_info->segment_name, local_buf);
- dev_info->segment_type = seg_info->segment_type;
- INIT_LIST_HEAD(&dev_info->seg_list);
+ strcpy(ddi->segment_name, local_buf);
+ ddi->segment_type = seg_info->segment_type;
+ INIT_LIST_HEAD(&ddi->seg_list);
}
- list_add_tail(&seg_info->lh, &dev_info->seg_list);
+ list_add_tail(&seg_info->lh, &ddi->seg_list);
num_of_segments++;
i = j;
@@ -580,39 +580,39 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
goto seg_list_del;
}
strlcpy(local_buf, buf, i + 1);
- dev_info->num_of_segments = num_of_segments;
- rc = dcssblk_is_continuous(dev_info);
+ ddi->num_of_segments = num_of_segments;
+ rc = dcssblk_is_continuous(ddi);
if (rc < 0)
goto seg_list_del;
- dev_info->start = dcssblk_find_lowest_addr(dev_info);
- dev_info->end = dcssblk_find_highest_addr(dev_info);
+ ddi->start = dcssblk_find_lowest_addr(ddi);
+ ddi->end = dcssblk_find_highest_addr(ddi);
- dev_set_name(&dev_info->dev, dev_info->segment_name);
- dev_info->dev.release = dcssblk_release_segment;
- INIT_LIST_HEAD(&dev_info->lh);
- dev_info->gd = alloc_disk(DCSSBLK_MINORS_PER_DISK);
- if (dev_info->gd == NULL) {
+ dev_set_name(&ddi->dev, ddi->segment_name);
+ ddi->dev.release = dcssblk_release_segment;
+ INIT_LIST_HEAD(&ddi->lh);
+ ddi->gd = alloc_disk(DCSSBLK_MINORS_PER_DISK);
+ if (ddi->gd == NULL) {
rc = -ENOMEM;
goto seg_list_del;
}
- dev_info->gd->major = dcssblk_major;
- dev_info->gd->fops = &dcssblk_devops;
- dev_info->dcssblk_queue = blk_alloc_queue(GFP_KERNEL);
- dev_info->gd->queue = dev_info->dcssblk_queue;
- dev_info->gd->private_data = dev_info;
- dev_info->gd->driverfs_dev = &dev_info->dev;
- blk_queue_make_request(dev_info->dcssblk_queue, dcssblk_make_request);
- blk_queue_logical_block_size(dev_info->dcssblk_queue, 4096);
-
- seg_byte_size = (dev_info->end - dev_info->start + 1);
- set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors
+ ddi->gd->major = dcssblk_major;
+ ddi->gd->fops = &dcssblk_devops;
+ ddi->dcssblk_queue = blk_alloc_queue(GFP_KERNEL);
+ ddi->gd->queue = ddi->dcssblk_queue;
+ ddi->gd->private_data = ddi;
+ ddi->gd->driverfs_dev = &ddi->dev;
+ blk_queue_make_request(ddi->dcssblk_queue, dcssblk_make_request);
+ blk_queue_logical_block_size(ddi->dcssblk_queue, 4096);
+
+ seg_byte_size = (ddi->end - ddi->start + 1);
+ set_capacity(ddi->gd, seg_byte_size >> 9); // size in sectors
pr_info("Loaded %s with total size %lu bytes and capacity %lu "
"sectors\n", local_buf, seg_byte_size, seg_byte_size >> 9);
- dev_info->save_pending = 0;
- dev_info->is_shared = 1;
- dev_info->dev.parent = dcssblk_root_dev;
+ ddi->save_pending = 0;
+ ddi->is_shared = 1;
+ ddi->dev.parent = dcssblk_root_dev;
/*
*get minor, add to list
@@ -622,12 +622,12 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
rc = -EEXIST;
goto release_gd;
}
- rc = dcssblk_assign_free_minor(dev_info);
+ rc = dcssblk_assign_free_minor(ddi);
if (rc)
goto release_gd;
- sprintf(dev_info->gd->disk_name, "dcssblk%d",
- dev_info->gd->first_minor);
- list_add_tail(&dev_info->lh, &dcssblk_devices);
+ sprintf(ddi->gd->disk_name, "dcssblk%d",
+ ddi->gd->first_minor);
+ list_add_tail(&ddi->lh, &dcssblk_devices);
if (!try_module_get(THIS_MODULE)) {
rc = -ENODEV;
@@ -636,32 +636,32 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
/*
* register the device
*/
- rc = device_register(&dev_info->dev);
+ rc = device_register(&ddi->dev);
if (rc) {
module_put(THIS_MODULE);
goto dev_list_del;
}
- get_device(&dev_info->dev);
- rc = device_create_file(&dev_info->dev, &dev_attr_shared);
+ get_device(&ddi->dev);
+ rc = device_create_file(&ddi->dev, &dev_attr_shared);
if (rc)
goto unregister_dev;
- rc = device_create_file(&dev_info->dev, &dev_attr_save);
+ rc = device_create_file(&ddi->dev, &dev_attr_save);
if (rc)
goto unregister_dev;
- rc = device_create_file(&dev_info->dev, &dev_attr_seglist);
+ rc = device_create_file(&ddi->dev, &dev_attr_seglist);
if (rc)
goto unregister_dev;
- add_disk(dev_info->gd);
+ add_disk(ddi->gd);
- switch (dev_info->segment_type) {
+ switch (ddi->segment_type) {
case SEG_TYPE_SR:
case SEG_TYPE_ER:
case SEG_TYPE_SC:
- set_disk_ro(dev_info->gd,1);
+ set_disk_ro(ddi->gd,1);
break;
default:
- set_disk_ro(dev_info->gd,0);
+ set_disk_ro(ddi->gd,0);
break;
}
up_write(&dcssblk_devices_sem);
@@ -669,33 +669,33 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
goto out;
unregister_dev:
- list_del(&dev_info->lh);
- blk_cleanup_queue(dev_info->dcssblk_queue);
- dev_info->gd->queue = NULL;
- put_disk(dev_info->gd);
- device_unregister(&dev_info->dev);
- list_for_each_entry(seg_info, &dev_info->seg_list, lh) {
+ list_del(&ddi->lh);
+ blk_cleanup_queue(ddi->dcssblk_queue);
+ ddi->gd->queue = NULL;
+ put_disk(ddi->gd);
+ device_unregister(&ddi->dev);
+ list_for_each_entry(seg_info, &ddi->seg_list, lh) {
segment_unload(seg_info->segment_name);
}
- put_device(&dev_info->dev);
+ put_device(&ddi->dev);
up_write(&dcssblk_devices_sem);
goto out;
dev_list_del:
- list_del(&dev_info->lh);
+ list_del(&ddi->lh);
release_gd:
- blk_cleanup_queue(dev_info->dcssblk_queue);
- dev_info->gd->queue = NULL;
- put_disk(dev_info->gd);
+ blk_cleanup_queue(ddi->dcssblk_queue);
+ ddi->gd->queue = NULL;
+ put_disk(ddi->gd);
up_write(&dcssblk_devices_sem);
seg_list_del:
- if (dev_info == NULL)
+ if (ddi == NULL)
goto out;
- list_for_each_entry_safe(seg_info, temp, &dev_info->seg_list, lh) {
+ list_for_each_entry_safe(seg_info, temp, &ddi->seg_list, lh) {
list_del(&seg_info->lh);
segment_unload(seg_info->segment_name);
kfree(seg_info);
}
- kfree(dev_info);
+ kfree(ddi);
out:
kfree(local_buf);
out_nobuf:
@@ -708,7 +708,7 @@ out_nobuf:
static ssize_t
dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *entry;
int rc, i;
char *local_buf;
@@ -733,15 +733,15 @@ dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const ch
}
down_write(&dcssblk_devices_sem);
- dev_info = dcssblk_get_device_by_name(local_buf);
- if (dev_info == NULL) {
+ ddi = dcssblk_get_device_by_name(local_buf);
+ if (ddi == NULL) {
up_write(&dcssblk_devices_sem);
pr_warning("Device %s cannot be removed because it is not a "
"known device\n", local_buf);
rc = -ENODEV;
goto out_buf;
}
- if (atomic_read(&dev_info->use_count) != 0) {
+ if (atomic_read(&ddi->use_count) != 0) {
up_write(&dcssblk_devices_sem);
pr_warning("Device %s cannot be removed while it is in "
"use\n", local_buf);
@@ -749,18 +749,18 @@ dcssblk_remove_store(struct device *dev, struct device_attribute *attr, const ch
goto out_buf;
}
- list_del(&dev_info->lh);
- del_gendisk(dev_info->gd);
- blk_cleanup_queue(dev_info->dcssblk_queue);
- dev_info->gd->queue = NULL;
- put_disk(dev_info->gd);
- device_unregister(&dev_info->dev);
+ list_del(&ddi->lh);
+ del_gendisk(ddi->gd);
+ blk_cleanup_queue(ddi->dcssblk_queue);
+ ddi->gd->queue = NULL;
+ put_disk(ddi->gd);
+ device_unregister(&ddi->dev);
/* unload all related segments */
- list_for_each_entry(entry, &dev_info->seg_list, lh)
+ list_for_each_entry(entry, &ddi->seg_list, lh)
segment_unload(entry->segment_name);
- put_device(&dev_info->dev);
+ put_device(&ddi->dev);
up_write(&dcssblk_devices_sem);
rc = count;
@@ -772,15 +772,15 @@ out_buf:
static int
dcssblk_open(struct block_device *bdev, fmode_t mode)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
int rc;
- dev_info = bdev->bd_disk->private_data;
- if (NULL == dev_info) {
+ ddi = bdev->bd_disk->private_data;
+ if (NULL == ddi) {
rc = -ENODEV;
goto out;
}
- atomic_inc(&dev_info->use_count);
+ atomic_inc(&ddi->use_count);
bdev->bd_block_size = 4096;
rc = 0;
out:
@@ -790,23 +790,23 @@ out:
static int
dcssblk_release(struct gendisk *disk, fmode_t mode)
{
- struct dcssblk_dev_info *dev_info = disk->private_data;
+ struct dcssblk_dev_info *ddi = disk->private_data;
struct segment_info *entry;
int rc;
- if (!dev_info) {
+ if (!ddi) {
rc = -ENODEV;
goto out;
}
down_write(&dcssblk_devices_sem);
- if (atomic_dec_and_test(&dev_info->use_count)
- && (dev_info->save_pending)) {
+ if (atomic_dec_and_test(&ddi->use_count)
+ && (ddi->save_pending)) {
pr_info("Device %s has become idle and is being saved "
- "now\n", dev_info->segment_name);
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ "now\n", ddi->segment_name);
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
segment_save(entry->segment_name);
}
- dev_info->save_pending = 0;
+ ddi->save_pending = 0;
}
up_write(&dcssblk_devices_sem);
rc = 0;
@@ -817,7 +817,7 @@ out:
static int
dcssblk_make_request(struct request_queue *q, struct bio *bio)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct bio_vec *bvec;
unsigned long index;
unsigned long page_addr;
@@ -826,8 +826,8 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
int i;
bytes_done = 0;
- dev_info = bio->bi_bdev->bd_disk->private_data;
- if (dev_info == NULL)
+ ddi = bio->bi_bdev->bd_disk->private_data;
+ if (ddi == NULL)
goto fail;
if ((bio->bi_sector & 7) != 0 || (bio->bi_size & 4095) != 0)
/* Request is not page-aligned. */
@@ -838,8 +838,8 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
goto fail;
}
/* verify data transfer direction */
- if (dev_info->is_shared) {
- switch (dev_info->segment_type) {
+ if (ddi->is_shared) {
+ switch (ddi->segment_type) {
case SEG_TYPE_SR:
case SEG_TYPE_ER:
case SEG_TYPE_SC:
@@ -847,7 +847,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
if (bio_data_dir(bio) == WRITE) {
pr_warning("Writing to %s failed because it "
"is a read-only device\n",
- dev_name(&dev_info->dev));
+ dev_name(&ddi->dev));
goto fail;
}
}
@@ -857,7 +857,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
bio_for_each_segment(bvec, bio, i) {
page_addr = (unsigned long)
page_address(bvec->bv_page) + bvec->bv_offset;
- source_addr = dev_info->start + (index<<12) + bytes_done;
+ source_addr = ddi->start + (index<<12) + bytes_done;
if (unlikely((page_addr & 4095) != 0) || (bvec->bv_len & 4095) != 0)
// More paranoia.
goto fail;
@@ -881,18 +881,18 @@ static int
dcssblk_direct_access (struct block_device *bdev, sector_t secnum,
void **kaddr, unsigned long *pfn)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
unsigned long pgoff;
- dev_info = bdev->bd_disk->private_data;
- if (!dev_info)
+ ddi = bdev->bd_disk->private_data;
+ if (!ddi)
return -ENODEV;
if (secnum % (PAGE_SIZE/512))
return -EINVAL;
pgoff = secnum / (PAGE_SIZE / 512);
- if ((pgoff+1)*PAGE_SIZE-1 > dev_info->end - dev_info->start)
+ if ((pgoff+1)*PAGE_SIZE-1 > ddi->end - ddi->start)
return -ERANGE;
- *kaddr = (void *) (dev_info->start+pgoff*PAGE_SIZE);
+ *kaddr = (void *) (ddi->start+pgoff*PAGE_SIZE);
*pfn = virt_to_phys(*kaddr) >> PAGE_SHIFT;
return 0;
@@ -903,7 +903,7 @@ dcssblk_check_params(void)
{
int rc, i, j, k;
char buf[DCSSBLK_PARM_LEN + 1];
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
for (i = 0; (i < DCSSBLK_PARM_LEN) && (dcssblk_segments[i] != '\0');
i++) {
@@ -922,10 +922,10 @@ dcssblk_check_params(void)
buf[k] = '\0';
if (!strncmp(&dcssblk_segments[j], "(local)", 7)) {
down_read(&dcssblk_devices_sem);
- dev_info = dcssblk_get_device_by_name(buf);
+ ddi = dcssblk_get_device_by_name(buf);
up_read(&dcssblk_devices_sem);
- if (dev_info)
- dcssblk_shared_store(&dev_info->dev,
+ if (ddi)
+ dcssblk_shared_store(&ddi->dev,
NULL, "0\n", 2);
}
}
@@ -945,15 +945,15 @@ dcssblk_check_params(void)
*/
static int dcssblk_freeze(struct device *dev)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
int rc = 0;
- list_for_each_entry(dev_info, &dcssblk_devices, lh) {
- switch (dev_info->segment_type) {
+ list_for_each_entry(ddi, &dcssblk_devices, lh) {
+ switch (ddi->segment_type) {
case SEG_TYPE_SR:
case SEG_TYPE_ER:
case SEG_TYPE_SC:
- if (!dev_info->is_shared)
+ if (!ddi->is_shared)
rc = -EINVAL;
break;
default:
@@ -966,19 +966,19 @@ static int dcssblk_freeze(struct device *dev)
if (rc)
pr_err("Suspending the system failed because DCSS device %s "
"is writable\n",
- dev_info->segment_name);
+ ddi->segment_name);
return rc;
}
static int dcssblk_restore(struct device *dev)
{
- struct dcssblk_dev_info *dev_info;
+ struct dcssblk_dev_info *ddi;
struct segment_info *entry;
unsigned long start, end;
int rc = 0;
- list_for_each_entry(dev_info, &dcssblk_devices, lh) {
- list_for_each_entry(entry, &dev_info->seg_list, lh) {
+ list_for_each_entry(ddi, &dcssblk_devices, lh) {
+ list_for_each_entry(entry, &ddi->seg_list, lh) {
segment_unload(entry->segment_name);
rc = segment_load(entry->segment_name, SEGMENT_SHARED,
&start, &end);
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* [PATCH 05/11] drivers/edac/amd: Rename dev_info to adi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (3 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 04/11] drivers/s390/block/dcssblk.c: Rename dev_info to ddi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-05 19:05 ` [PATCH 06/11] drivers/edac/cpc925_edac.c: Rename dev_info to cdi Joe Perches
` (5 subsequent siblings)
10 siblings, 0 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/edac/amd8111_edac.c | 88 +++++++++++++++++++++---------------------
drivers/edac/amd8131_edac.c | 86 +++++++++++++++++++++---------------------
2 files changed, 87 insertions(+), 87 deletions(-)
diff --git a/drivers/edac/amd8111_edac.c b/drivers/edac/amd8111_edac.c
index 35b78d0..48770c7 100644
--- a/drivers/edac/amd8111_edac.c
+++ b/drivers/edac/amd8111_edac.c
@@ -243,10 +243,10 @@ static int at_compat_reg_broken;
#define LEGACY_NR_PORTS 1
/* device-specific methods for amd8111 LPC Bridge device */
-static void amd8111_lpc_bridge_init(struct amd8111_dev_info *dev_info)
+static void amd8111_lpc_bridge_init(struct amd8111_dev_info *adi)
{
u8 val8;
- struct pci_dev *dev = dev_info->dev;
+ struct pci_dev *dev = adi->dev;
/* First clear REG_AT_COMPAT[SERR, IOCHK] if necessary */
legacy_io_res = request_region(REG_AT_COMPAT, LEGACY_NR_PORTS,
@@ -280,7 +280,7 @@ static void amd8111_lpc_bridge_init(struct amd8111_dev_info *dev_info)
edac_pci_write_byte(dev, REG_IO_CTRL_1, val8);
}
-static void amd8111_lpc_bridge_exit(struct amd8111_dev_info *dev_info)
+static void amd8111_lpc_bridge_exit(struct amd8111_dev_info *adi)
{
if (legacy_io_res)
release_region(REG_AT_COMPAT, LEGACY_NR_PORTS);
@@ -288,15 +288,15 @@ static void amd8111_lpc_bridge_exit(struct amd8111_dev_info *dev_info)
static void amd8111_lpc_bridge_check(struct edac_device_ctl_info *edac_dev)
{
- struct amd8111_dev_info *dev_info = edac_dev->pvt_info;
- struct pci_dev *dev = dev_info->dev;
+ struct amd8111_dev_info *adi = edac_dev->pvt_info;
+ struct pci_dev *dev = adi->dev;
u8 val8;
edac_pci_read_byte(dev, REG_IO_CTRL_1, &val8);
if (val8 & IO_CTRL_1_CLEAR_MASK) {
printk(KERN_INFO
"Error(s) in IO control register on %s device\n",
- dev_info->ctl_name);
+ adi->ctl_name);
printk(KERN_INFO "LPC ERR: %d, PW2LPC: %d\n",
(val8 & IO_CTRL_1_LPC_ERR) != 0,
(val8 & IO_CTRL_1_PW2LPC) != 0);
@@ -349,25 +349,25 @@ static struct amd8111_pci_info amd8111_pcis[] = {
static int amd8111_dev_probe(struct pci_dev *dev,
const struct pci_device_id *id)
{
- struct amd8111_dev_info *dev_info = &amd8111_devices[id->driver_data];
+ struct amd8111_dev_info *adi = &amd8111_devices[id->driver_data];
- dev_info->dev = pci_get_device(PCI_VENDOR_ID_AMD,
- dev_info->err_dev, NULL);
+ adi->dev = pci_get_device(PCI_VENDOR_ID_AMD,
+ adi->err_dev, NULL);
- if (!dev_info->dev) {
+ if (!adi->dev) {
printk(KERN_ERR "EDAC device not found:"
"vendor %x, device %x, name %s\n",
- PCI_VENDOR_ID_AMD, dev_info->err_dev,
- dev_info->ctl_name);
+ PCI_VENDOR_ID_AMD, adi->err_dev,
+ adi->ctl_name);
return -ENODEV;
}
- if (pci_enable_device(dev_info->dev)) {
- pci_dev_put(dev_info->dev);
+ if (pci_enable_device(adi->dev)) {
+ pci_dev_put(adi->dev);
printk(KERN_ERR "failed to enable:"
"vendor %x, device %x, name %s\n",
- PCI_VENDOR_ID_AMD, dev_info->err_dev,
- dev_info->ctl_name);
+ PCI_VENDOR_ID_AMD, adi->err_dev,
+ adi->ctl_name);
return -ENODEV;
}
@@ -376,61 +376,61 @@ static int amd8111_dev_probe(struct pci_dev *dev,
* edac_device_ctl_info, but make use of existing
* one instead.
*/
- dev_info->edac_idx = edac_device_alloc_index();
- dev_info->edac_dev =
- edac_device_alloc_ctl_info(0, dev_info->ctl_name, 1,
+ adi->edac_idx = edac_device_alloc_index();
+ adi->edac_dev =
+ edac_device_alloc_ctl_info(0, adi->ctl_name, 1,
NULL, 0, 0,
- NULL, 0, dev_info->edac_idx);
- if (!dev_info->edac_dev)
+ NULL, 0, adi->edac_idx);
+ if (!adi->edac_dev)
return -ENOMEM;
- dev_info->edac_dev->pvt_info = dev_info;
- dev_info->edac_dev->dev = &dev_info->dev->dev;
- dev_info->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
- dev_info->edac_dev->ctl_name = dev_info->ctl_name;
- dev_info->edac_dev->dev_name = dev_name(&dev_info->dev->dev);
+ adi->edac_dev->pvt_info = adi;
+ adi->edac_dev->dev = &adi->dev->dev;
+ adi->edac_dev->mod_name = AMD8111_EDAC_MOD_STR;
+ adi->edac_dev->ctl_name = adi->ctl_name;
+ adi->edac_dev->dev_name = dev_name(&adi->dev->dev);
if (edac_op_state == EDAC_OPSTATE_POLL)
- dev_info->edac_dev->edac_check = dev_info->check;
+ adi->edac_dev->edac_check = adi->check;
- if (dev_info->init)
- dev_info->init(dev_info);
+ if (adi->init)
+ adi->init(adi);
- if (edac_device_add_device(dev_info->edac_dev) > 0) {
+ if (edac_device_add_device(adi->edac_dev) > 0) {
printk(KERN_ERR "failed to add edac_dev for %s\n",
- dev_info->ctl_name);
- edac_device_free_ctl_info(dev_info->edac_dev);
+ adi->ctl_name);
+ edac_device_free_ctl_info(adi->edac_dev);
return -ENODEV;
}
printk(KERN_INFO "added one edac_dev on AMD8111 "
"vendor %x, device %x, name %s\n",
- PCI_VENDOR_ID_AMD, dev_info->err_dev,
- dev_info->ctl_name);
+ PCI_VENDOR_ID_AMD, adi->err_dev,
+ adi->ctl_name);
return 0;
}
static void amd8111_dev_remove(struct pci_dev *dev)
{
- struct amd8111_dev_info *dev_info;
+ struct amd8111_dev_info *adi;
- for (dev_info = amd8111_devices; dev_info->err_dev; dev_info++)
- if (dev_info->dev->device == dev->device)
+ for (adi = amd8111_devices; adi->err_dev; adi++)
+ if (adi->dev->device == dev->device)
break;
- if (!dev_info->err_dev) /* should never happen */
+ if (!adi->err_dev) /* should never happen */
return;
- if (dev_info->edac_dev) {
- edac_device_del_device(dev_info->edac_dev->dev);
- edac_device_free_ctl_info(dev_info->edac_dev);
+ if (adi->edac_dev) {
+ edac_device_del_device(adi->edac_dev->dev);
+ edac_device_free_ctl_info(adi->edac_dev);
}
- if (dev_info->exit)
- dev_info->exit(dev_info);
+ if (adi->exit)
+ adi->exit(adi);
- pci_dev_put(dev_info->dev);
+ pci_dev_put(adi->dev);
}
static int amd8111_pci_probe(struct pci_dev *dev,
diff --git a/drivers/edac/amd8131_edac.c b/drivers/edac/amd8131_edac.c
index b432d60..fbf8d1b 100644
--- a/drivers/edac/amd8131_edac.c
+++ b/drivers/edac/amd8131_edac.c
@@ -90,10 +90,10 @@ static struct amd8131_dev_info amd8131_devices[] = {
{.inst = NO_BRIDGE,},
};
-static void amd8131_pcix_init(struct amd8131_dev_info *dev_info)
+static void amd8131_pcix_init(struct amd8131_dev_info *adi)
{
u32 val32;
- struct pci_dev *dev = dev_info->dev;
+ struct pci_dev *dev = adi->dev;
/* First clear error detection flags */
edac_pci_read_dword(dev, REG_MEM_LIM, &val32);
@@ -141,10 +141,10 @@ static void amd8131_pcix_init(struct amd8131_dev_info *dev_info)
edac_pci_write_dword(dev, REG_LNK_CTRL_B, val32);
}
-static void amd8131_pcix_exit(struct amd8131_dev_info *dev_info)
+static void amd8131_pcix_exit(struct amd8131_dev_info *adi)
{
u32 val32;
- struct pci_dev *dev = dev_info->dev;
+ struct pci_dev *dev = adi->dev;
/* Disable SERR, PERR and DTSE Error detection */
edac_pci_read_dword(dev, REG_INT_CTLR, &val32);
@@ -169,15 +169,15 @@ static void amd8131_pcix_exit(struct amd8131_dev_info *dev_info)
static void amd8131_pcix_check(struct edac_pci_ctl_info *edac_dev)
{
- struct amd8131_dev_info *dev_info = edac_dev->pvt_info;
- struct pci_dev *dev = dev_info->dev;
+ struct amd8131_dev_info *adi = edac_dev->pvt_info;
+ struct pci_dev *dev = adi->dev;
u32 val32;
/* Check PCI-X Bridge Memory Base-Limit Register for errors */
edac_pci_read_dword(dev, REG_MEM_LIM, &val32);
if (val32 & MEM_LIMIT_MASK) {
printk(KERN_INFO "Error(s) in mem limit register "
- "on %s bridge\n", dev_info->ctl_name);
+ "on %s bridge\n", adi->ctl_name);
printk(KERN_INFO "DPE: %d, RSE: %d, RMA: %d\n"
"RTA: %d, STA: %d, MDPE: %d\n",
val32 & MEM_LIMIT_DPE,
@@ -197,7 +197,7 @@ static void amd8131_pcix_check(struct edac_pci_ctl_info *edac_dev)
edac_pci_read_dword(dev, REG_INT_CTLR, &val32);
if (val32 & INT_CTLR_DTS) {
printk(KERN_INFO "Error(s) in interrupt and control register "
- "on %s bridge\n", dev_info->ctl_name);
+ "on %s bridge\n", adi->ctl_name);
printk(KERN_INFO "DTS: %d\n", val32 & INT_CTLR_DTS);
val32 |= INT_CTLR_DTS;
@@ -210,7 +210,7 @@ static void amd8131_pcix_check(struct edac_pci_ctl_info *edac_dev)
edac_pci_read_dword(dev, REG_LNK_CTRL_A, &val32);
if (val32 & LNK_CTRL_CRCERR_A) {
printk(KERN_INFO "Error(s) in link conf and control register "
- "on %s bridge\n", dev_info->ctl_name);
+ "on %s bridge\n", adi->ctl_name);
printk(KERN_INFO "CRCERR: %d\n", val32 & LNK_CTRL_CRCERR_A);
val32 |= LNK_CTRL_CRCERR_A;
@@ -223,7 +223,7 @@ static void amd8131_pcix_check(struct edac_pci_ctl_info *edac_dev)
edac_pci_read_dword(dev, REG_LNK_CTRL_B, &val32);
if (val32 & LNK_CTRL_CRCERR_B) {
printk(KERN_INFO "Error(s) in link conf and control register "
- "on %s bridge\n", dev_info->ctl_name);
+ "on %s bridge\n", adi->ctl_name);
printk(KERN_INFO "CRCERR: %d\n", val32 & LNK_CTRL_CRCERR_B);
val32 |= LNK_CTRL_CRCERR_B;
@@ -248,28 +248,28 @@ static struct amd8131_info amd8131_chipset = {
*/
static int amd8131_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
- struct amd8131_dev_info *dev_info;
+ struct amd8131_dev_info *adi;
- for (dev_info = amd8131_chipset.devices; dev_info->inst != NO_BRIDGE;
- dev_info++)
- if (dev_info->devfn == dev->devfn)
+ for (adi = amd8131_chipset.devices; adi->inst != NO_BRIDGE;
+ adi++)
+ if (adi->devfn == dev->devfn)
break;
- if (dev_info->inst == NO_BRIDGE) /* should never happen */
+ if (adi->inst == NO_BRIDGE) /* should never happen */
return -ENODEV;
/*
* We can't call pci_get_device() as we are used to do because
* there are 4 of them but pci_dev_get() instead.
*/
- dev_info->dev = pci_dev_get(dev);
+ adi->dev = pci_dev_get(dev);
- if (pci_enable_device(dev_info->dev)) {
- pci_dev_put(dev_info->dev);
+ if (pci_enable_device(adi->dev)) {
+ pci_dev_put(adi->dev);
printk(KERN_ERR "failed to enable:"
"vendor %x, device %x, devfn %x, name %s\n",
PCI_VENDOR_ID_AMD, amd8131_chipset.err_dev,
- dev_info->devfn, dev_info->ctl_name);
+ adi->devfn, adi->ctl_name);
return -ENODEV;
}
@@ -278,59 +278,59 @@ static int amd8131_probe(struct pci_dev *dev, const struct pci_device_id *id)
* edac_pci_ctl_info, but make use of existing
* one instead.
*/
- dev_info->edac_idx = edac_pci_alloc_index();
- dev_info->edac_dev = edac_pci_alloc_ctl_info(0, dev_info->ctl_name);
- if (!dev_info->edac_dev)
+ adi->edac_idx = edac_pci_alloc_index();
+ adi->edac_dev = edac_pci_alloc_ctl_info(0, adi->ctl_name);
+ if (!adi->edac_dev)
return -ENOMEM;
- dev_info->edac_dev->pvt_info = dev_info;
- dev_info->edac_dev->dev = &dev_info->dev->dev;
- dev_info->edac_dev->mod_name = AMD8131_EDAC_MOD_STR;
- dev_info->edac_dev->ctl_name = dev_info->ctl_name;
- dev_info->edac_dev->dev_name = dev_name(&dev_info->dev->dev);
+ adi->edac_dev->pvt_info = adi;
+ adi->edac_dev->dev = &adi->dev->dev;
+ adi->edac_dev->mod_name = AMD8131_EDAC_MOD_STR;
+ adi->edac_dev->ctl_name = adi->ctl_name;
+ adi->edac_dev->dev_name = dev_name(&adi->dev->dev);
if (edac_op_state == EDAC_OPSTATE_POLL)
- dev_info->edac_dev->edac_check = amd8131_chipset.check;
+ adi->edac_dev->edac_check = amd8131_chipset.check;
if (amd8131_chipset.init)
- amd8131_chipset.init(dev_info);
+ amd8131_chipset.init(adi);
- if (edac_pci_add_device(dev_info->edac_dev, dev_info->edac_idx) > 0) {
+ if (edac_pci_add_device(adi->edac_dev, adi->edac_idx) > 0) {
printk(KERN_ERR "failed edac_pci_add_device() for %s\n",
- dev_info->ctl_name);
- edac_pci_free_ctl_info(dev_info->edac_dev);
+ adi->ctl_name);
+ edac_pci_free_ctl_info(adi->edac_dev);
return -ENODEV;
}
printk(KERN_INFO "added one device on AMD8131 "
"vendor %x, device %x, devfn %x, name %s\n",
PCI_VENDOR_ID_AMD, amd8131_chipset.err_dev,
- dev_info->devfn, dev_info->ctl_name);
+ adi->devfn, adi->ctl_name);
return 0;
}
static void amd8131_remove(struct pci_dev *dev)
{
- struct amd8131_dev_info *dev_info;
+ struct amd8131_dev_info *adi;
- for (dev_info = amd8131_chipset.devices; dev_info->inst != NO_BRIDGE;
- dev_info++)
- if (dev_info->devfn == dev->devfn)
+ for (adi = amd8131_chipset.devices; adi->inst != NO_BRIDGE;
+ adi++)
+ if (adi->devfn == dev->devfn)
break;
- if (dev_info->inst == NO_BRIDGE) /* should never happen */
+ if (adi->inst == NO_BRIDGE) /* should never happen */
return;
- if (dev_info->edac_dev) {
- edac_pci_del_device(dev_info->edac_dev->dev);
- edac_pci_free_ctl_info(dev_info->edac_dev);
+ if (adi->edac_dev) {
+ edac_pci_del_device(adi->edac_dev->dev);
+ edac_pci_free_ctl_info(adi->edac_dev);
}
if (amd8131_chipset.exit)
- amd8131_chipset.exit(dev_info);
+ amd8131_chipset.exit(adi);
- pci_dev_put(dev_info->dev);
+ pci_dev_put(adi->dev);
}
static const struct pci_device_id amd8131_edac_pci_tbl[] = {
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* [PATCH 06/11] drivers/edac/cpc925_edac.c: Rename dev_info to cdi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (4 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 05/11] drivers/edac/amd: Rename dev_info to adi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-05 19:05 ` [PATCH 07/11] drivers/edac/e7*_edac.c: Rename dev_info to edi Joe Perches
` (4 subsequent siblings)
10 siblings, 0 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/edac/cpc925_edac.c | 122 ++++++++++++++++++++++----------------------
1 files changed, 61 insertions(+), 61 deletions(-)
diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
index 3d50274..484e77c 100644
--- a/drivers/edac/cpc925_edac.c
+++ b/drivers/edac/cpc925_edac.c
@@ -286,8 +286,8 @@ struct cpc925_dev_info {
char *ctl_name;
int edac_idx;
struct edac_device_ctl_info *edac_dev;
- void (*init)(struct cpc925_dev_info *dev_info);
- void (*exit)(struct cpc925_dev_info *dev_info);
+ void (*init)(struct cpc925_dev_info *cdi);
+ void (*exit)(struct cpc925_dev_info *cdi);
void (*check)(struct edac_device_ctl_info *edac_dev);
};
@@ -581,19 +581,19 @@ static void cpc925_mc_check(struct mem_ctl_info *mci)
/******************** CPU err device********************************/
/* Enable CPU Errors detection */
-static void cpc925_cpu_init(struct cpc925_dev_info *dev_info)
+static void cpc925_cpu_init(struct cpc925_dev_info *cdi)
{
u32 apimask;
- apimask = __raw_readl(dev_info->vbase + REG_APIMASK_OFFSET);
+ apimask = __raw_readl(cdi->vbase + REG_APIMASK_OFFSET);
if ((apimask & CPU_MASK_ENABLE) == 0) {
apimask |= CPU_MASK_ENABLE;
- __raw_writel(apimask, dev_info->vbase + REG_APIMASK_OFFSET);
+ __raw_writel(apimask, cdi->vbase + REG_APIMASK_OFFSET);
}
}
/* Disable CPU Errors detection */
-static void cpc925_cpu_exit(struct cpc925_dev_info *dev_info)
+static void cpc925_cpu_exit(struct cpc925_dev_info *cdi)
{
/*
* WARNING:
@@ -612,16 +612,16 @@ static void cpc925_cpu_exit(struct cpc925_dev_info *dev_info)
/* Check for CPU Errors */
static void cpc925_cpu_check(struct edac_device_ctl_info *edac_dev)
{
- struct cpc925_dev_info *dev_info = edac_dev->pvt_info;
+ struct cpc925_dev_info *cdi = edac_dev->pvt_info;
u32 apiexcp;
u32 apimask;
/* APIEXCP is cleared when read */
- apiexcp = __raw_readl(dev_info->vbase + REG_APIEXCP_OFFSET);
+ apiexcp = __raw_readl(cdi->vbase + REG_APIEXCP_OFFSET);
if ((apiexcp & CPU_EXCP_DETECTED) == 0)
return;
- apimask = __raw_readl(dev_info->vbase + REG_APIMASK_OFFSET);
+ apimask = __raw_readl(cdi->vbase + REG_APIMASK_OFFSET);
cpc925_printk(KERN_INFO, "Processor Interface Fault\n"
"Processor Interface register dump:\n");
cpc925_printk(KERN_INFO, "APIMASK 0x%08x\n", apimask);
@@ -632,35 +632,35 @@ static void cpc925_cpu_check(struct edac_device_ctl_info *edac_dev)
/******************** HT Link err device****************************/
/* Enable HyperTransport Link Error detection */
-static void cpc925_htlink_init(struct cpc925_dev_info *dev_info)
+static void cpc925_htlink_init(struct cpc925_dev_info *cdi)
{
u32 ht_errctrl;
- ht_errctrl = __raw_readl(dev_info->vbase + REG_ERRCTRL_OFFSET);
+ ht_errctrl = __raw_readl(cdi->vbase + REG_ERRCTRL_OFFSET);
if ((ht_errctrl & HT_ERRCTRL_ENABLE) == 0) {
ht_errctrl |= HT_ERRCTRL_ENABLE;
- __raw_writel(ht_errctrl, dev_info->vbase + REG_ERRCTRL_OFFSET);
+ __raw_writel(ht_errctrl, cdi->vbase + REG_ERRCTRL_OFFSET);
}
}
/* Disable HyperTransport Link Error detection */
-static void cpc925_htlink_exit(struct cpc925_dev_info *dev_info)
+static void cpc925_htlink_exit(struct cpc925_dev_info *cdi)
{
u32 ht_errctrl;
- ht_errctrl = __raw_readl(dev_info->vbase + REG_ERRCTRL_OFFSET);
+ ht_errctrl = __raw_readl(cdi->vbase + REG_ERRCTRL_OFFSET);
ht_errctrl &= ~HT_ERRCTRL_ENABLE;
- __raw_writel(ht_errctrl, dev_info->vbase + REG_ERRCTRL_OFFSET);
+ __raw_writel(ht_errctrl, cdi->vbase + REG_ERRCTRL_OFFSET);
}
/* Check for HyperTransport Link errors */
static void cpc925_htlink_check(struct edac_device_ctl_info *edac_dev)
{
- struct cpc925_dev_info *dev_info = edac_dev->pvt_info;
- u32 brgctrl = __raw_readl(dev_info->vbase + REG_BRGCTRL_OFFSET);
- u32 linkctrl = __raw_readl(dev_info->vbase + REG_LINKCTRL_OFFSET);
- u32 errctrl = __raw_readl(dev_info->vbase + REG_ERRCTRL_OFFSET);
- u32 linkerr = __raw_readl(dev_info->vbase + REG_LINKERR_OFFSET);
+ struct cpc925_dev_info *cdi = edac_dev->pvt_info;
+ u32 brgctrl = __raw_readl(cdi->vbase + REG_BRGCTRL_OFFSET);
+ u32 linkctrl = __raw_readl(cdi->vbase + REG_LINKCTRL_OFFSET);
+ u32 errctrl = __raw_readl(cdi->vbase + REG_ERRCTRL_OFFSET);
+ u32 linkerr = __raw_readl(cdi->vbase + REG_LINKERR_OFFSET);
if (!((brgctrl & BRGCTRL_DETSERR) ||
(linkctrl & HT_LINKCTRL_DETECTED) ||
@@ -682,24 +682,24 @@ static void cpc925_htlink_check(struct edac_device_ctl_info *edac_dev)
/* Clear by write 1 */
if (brgctrl & BRGCTRL_DETSERR)
__raw_writel(BRGCTRL_DETSERR,
- dev_info->vbase + REG_BRGCTRL_OFFSET);
+ cdi->vbase + REG_BRGCTRL_OFFSET);
if (linkctrl & HT_LINKCTRL_DETECTED)
__raw_writel(HT_LINKCTRL_DETECTED,
- dev_info->vbase + REG_LINKCTRL_OFFSET);
+ cdi->vbase + REG_LINKCTRL_OFFSET);
/* Initiate Secondary Bus Reset to clear the chain failure */
if (errctrl & ERRCTRL_CHN_FAL)
__raw_writel(BRGCTRL_SECBUSRESET,
- dev_info->vbase + REG_BRGCTRL_OFFSET);
+ cdi->vbase + REG_BRGCTRL_OFFSET);
if (errctrl & ERRCTRL_RSP_ERR)
__raw_writel(ERRCTRL_RSP_ERR,
- dev_info->vbase + REG_ERRCTRL_OFFSET);
+ cdi->vbase + REG_ERRCTRL_OFFSET);
if (linkerr & HT_LINKERR_DETECTED)
__raw_writel(HT_LINKERR_DETECTED,
- dev_info->vbase + REG_LINKERR_OFFSET);
+ cdi->vbase + REG_LINKERR_OFFSET);
edac_device_handle_ce(edac_dev, 0, 0, edac_dev->ctl_name);
}
@@ -729,21 +729,21 @@ static struct cpc925_dev_info cpc925_devs[] = {
*/
static void cpc925_add_edac_devices(void __iomem *vbase)
{
- struct cpc925_dev_info *dev_info;
+ struct cpc925_dev_info *cdi;
if (!vbase) {
cpc925_printk(KERN_ERR, "MMIO not established yet\n");
return;
}
- for (dev_info = &cpc925_devs[0]; dev_info->init; dev_info++) {
- dev_info->vbase = vbase;
- dev_info->pdev = platform_device_register_simple(
- dev_info->ctl_name, 0, NULL, 0);
- if (IS_ERR(dev_info->pdev)) {
+ for (cdi = &cpc925_devs[0]; cdi->init; cdi++) {
+ cdi->vbase = vbase;
+ cdi->pdev = platform_device_register_simple(
+ cdi->ctl_name, 0, NULL, 0);
+ if (IS_ERR(cdi->pdev)) {
cpc925_printk(KERN_ERR,
"Can't register platform device for %s\n",
- dev_info->ctl_name);
+ cdi->ctl_name);
continue;
}
@@ -751,45 +751,45 @@ static void cpc925_add_edac_devices(void __iomem *vbase)
* Don't have to allocate private structure but
* make use of cpc925_devs[] instead.
*/
- dev_info->edac_idx = edac_device_alloc_index();
- dev_info->edac_dev =
- edac_device_alloc_ctl_info(0, dev_info->ctl_name,
- 1, NULL, 0, 0, NULL, 0, dev_info->edac_idx);
- if (!dev_info->edac_dev) {
+ cdi->edac_idx = edac_device_alloc_index();
+ cdi->edac_dev =
+ edac_device_alloc_ctl_info(0, cdi->ctl_name,
+ 1, NULL, 0, 0, NULL, 0, cdi->edac_idx);
+ if (!cdi->edac_dev) {
cpc925_printk(KERN_ERR, "No memory for edac device\n");
goto err1;
}
- dev_info->edac_dev->pvt_info = dev_info;
- dev_info->edac_dev->dev = &dev_info->pdev->dev;
- dev_info->edac_dev->ctl_name = dev_info->ctl_name;
- dev_info->edac_dev->mod_name = CPC925_EDAC_MOD_STR;
- dev_info->edac_dev->dev_name = dev_name(&dev_info->pdev->dev);
+ cdi->edac_dev->pvt_info = cdi;
+ cdi->edac_dev->dev = &cdi->pdev->dev;
+ cdi->edac_dev->ctl_name = cdi->ctl_name;
+ cdi->edac_dev->mod_name = CPC925_EDAC_MOD_STR;
+ cdi->edac_dev->dev_name = dev_name(&cdi->pdev->dev);
if (edac_op_state == EDAC_OPSTATE_POLL)
- dev_info->edac_dev->edac_check = dev_info->check;
+ cdi->edac_dev->edac_check = cdi->check;
- if (dev_info->init)
- dev_info->init(dev_info);
+ if (cdi->init)
+ cdi->init(cdi);
- if (edac_device_add_device(dev_info->edac_dev) > 0) {
+ if (edac_device_add_device(cdi->edac_dev) > 0) {
cpc925_printk(KERN_ERR,
"Unable to add edac device for %s\n",
- dev_info->ctl_name);
+ cdi->ctl_name);
goto err2;
}
debugf0("%s: Successfully added edac device for %s\n",
- __func__, dev_info->ctl_name);
+ __func__, cdi->ctl_name);
continue;
err2:
- if (dev_info->exit)
- dev_info->exit(dev_info);
- edac_device_free_ctl_info(dev_info->edac_dev);
+ if (cdi->exit)
+ cdi->exit(cdi);
+ edac_device_free_ctl_info(cdi->edac_dev);
err1:
- platform_device_unregister(dev_info->pdev);
+ platform_device_unregister(cdi->pdev);
}
}
@@ -799,20 +799,20 @@ err1:
*/
static void cpc925_del_edac_devices(void)
{
- struct cpc925_dev_info *dev_info;
+ struct cpc925_dev_info *cdi;
- for (dev_info = &cpc925_devs[0]; dev_info->init; dev_info++) {
- if (dev_info->edac_dev) {
- edac_device_del_device(dev_info->edac_dev->dev);
- edac_device_free_ctl_info(dev_info->edac_dev);
- platform_device_unregister(dev_info->pdev);
+ for (cdi = &cpc925_devs[0]; cdi->init; cdi++) {
+ if (cdi->edac_dev) {
+ edac_device_del_device(cdi->edac_dev->dev);
+ edac_device_free_ctl_info(cdi->edac_dev);
+ platform_device_unregister(cdi->pdev);
}
- if (dev_info->exit)
- dev_info->exit(dev_info);
+ if (cdi->exit)
+ cdi->exit(cdi);
debugf0("%s: Successfully deleted edac device for %s\n",
- __func__, dev_info->ctl_name);
+ __func__, cdi->ctl_name);
}
}
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* [PATCH 07/11] drivers/edac/e7*_edac.c: Rename dev_info to edi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (5 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 06/11] drivers/edac/cpc925_edac.c: Rename dev_info to cdi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-07 20:25 ` Doug Thompson
2010-04-05 19:05 ` [PATCH 08/11] drivers/staging/iio: Rename dev_info to idi Joe Perches
` (3 subsequent siblings)
10 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: Mark Gross, Doug Thompson, bluesmoke-devel, linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/edac/e752x_edac.c | 18 +++++++++---------
drivers/edac/e7xxx_edac.c | 8 ++++----
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 243e9aa..2d876ae 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -198,7 +198,7 @@ struct e752x_pvt {
int mc_symmetric;
u8 map[8];
int map_type;
- const struct e752x_dev_info *dev_info;
+ const struct e752x_dev_info *edi;
};
struct e752x_dev_info {
@@ -820,7 +820,7 @@ static void e752x_get_error_info(struct mem_ctl_info *mci,
pci_read_config_dword(dev, E752X_FERR_GLOBAL, &info->ferr_global);
if (info->ferr_global) {
- if (pvt->dev_info->err_dev == PCI_DEVICE_ID_INTEL_3100_1_ERR) {
+ if (pvt->edi->err_dev == PCI_DEVICE_ID_INTEL_3100_1_ERR) {
pci_read_config_dword(dev, I3100_NSI_FERR,
&info->nsi_ferr);
info->hi_ferr = 0;
@@ -872,7 +872,7 @@ static void e752x_get_error_info(struct mem_ctl_info *mci,
pci_read_config_dword(dev, E752X_NERR_GLOBAL, &info->nerr_global);
if (info->nerr_global) {
- if (pvt->dev_info->err_dev == PCI_DEVICE_ID_INTEL_3100_1_ERR) {
+ if (pvt->edi->err_dev == PCI_DEVICE_ID_INTEL_3100_1_ERR) {
pci_read_config_dword(dev, I3100_NSI_NERR,
&info->nsi_nerr);
info->hi_nerr = 0;
@@ -966,7 +966,7 @@ static int set_sdram_scrub_rate(struct mem_ctl_info *mci, u32 *new_bw)
struct pci_dev *pdev = pvt->dev_d0f0;
int i;
- if (pvt->dev_info->ctl_dev == PCI_DEVICE_ID_INTEL_3100_0)
+ if (pvt->edi->ctl_dev == PCI_DEVICE_ID_INTEL_3100_0)
scrubrates = scrubrates_i3100;
else
scrubrates = scrubrates_e752x;
@@ -996,7 +996,7 @@ static int get_sdram_scrub_rate(struct mem_ctl_info *mci, u32 *bw)
u16 scrubval;
int i;
- if (pvt->dev_info->ctl_dev == PCI_DEVICE_ID_INTEL_3100_0)
+ if (pvt->edi->ctl_dev == PCI_DEVICE_ID_INTEL_3100_0)
scrubrates = scrubrates_i3100;
else
scrubrates = scrubrates_e752x;
@@ -1146,7 +1146,7 @@ static int e752x_get_devs(struct pci_dev *pdev, int dev_idx,
struct pci_dev *dev;
pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
- pvt->dev_info->err_dev, pvt->bridge_ck);
+ pvt->edi->err_dev, pvt->bridge_ck);
if (pvt->bridge_ck == NULL)
pvt->bridge_ck = pci_scan_single_device(pdev->bus,
@@ -1207,7 +1207,7 @@ static void e752x_init_error_reporting_regs(struct e752x_pvt *pvt)
dev = pvt->dev_d0f1;
/* Turn off error disable & SMI in case the BIOS turned it on */
- if (pvt->dev_info->err_dev == PCI_DEVICE_ID_INTEL_3100_1_ERR) {
+ if (pvt->edi->err_dev == PCI_DEVICE_ID_INTEL_3100_1_ERR) {
pci_write_config_dword(dev, I3100_NSI_EMASK, 0);
pci_write_config_dword(dev, I3100_NSI_SMICMD, 0);
} else {
@@ -1273,7 +1273,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
debugf3("%s(): init pvt\n", __func__);
pvt = (struct e752x_pvt *)mci->pvt_info;
- pvt->dev_info = &e752x_devs[dev_idx];
+ pvt->edi = &e752x_devs[dev_idx];
pvt->mc_symmetric = ((ddrcsr & 0x10) != 0);
if (e752x_get_devs(pdev, dev_idx, pvt)) {
@@ -1282,7 +1282,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
}
debugf3("%s(): more mci init\n", __func__);
- mci->ctl_name = pvt->dev_info->ctl_name;
+ mci->ctl_name = pvt->edi->ctl_name;
mci->dev_name = pci_name(pdev);
mci->edac_check = e752x_check;
mci->ctl_page_to_phys = ctl_page_to_phys;
diff --git a/drivers/edac/e7xxx_edac.c b/drivers/edac/e7xxx_edac.c
index c7d11cc..3b82687 100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
@@ -128,7 +128,7 @@ struct e7xxx_pvt {
u32 tolm;
u32 remapbase;
u32 remaplimit;
- const struct e7xxx_dev_info *dev_info;
+ const struct e7xxx_dev_info *edi;
};
struct e7xxx_dev_info {
@@ -432,9 +432,9 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
mci->dev = &pdev->dev;
debugf3("%s(): init pvt\n", __func__);
pvt = (struct e7xxx_pvt *)mci->pvt_info;
- pvt->dev_info = &e7xxx_devs[dev_idx];
+ pvt->edi = &e7xxx_devs[dev_idx];
pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL,
- pvt->dev_info->err_dev, pvt->bridge_ck);
+ pvt->edi->err_dev, pvt->bridge_ck);
if (!pvt->bridge_ck) {
e7xxx_printk(KERN_ERR, "error reporting device not found:"
@@ -444,7 +444,7 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
}
debugf3("%s(): more mci init\n", __func__);
- mci->ctl_name = pvt->dev_info->ctl_name;
+ mci->ctl_name = pvt->edi->ctl_name;
mci->dev_name = pci_name(pdev);
mci->edac_check = e7xxx_check;
mci->ctl_page_to_phys = ctl_page_to_phys;
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 07/11] drivers/edac/e7*_edac.c: Rename dev_info to edi
2010-04-05 19:05 ` [PATCH 07/11] drivers/edac/e7*_edac.c: Rename dev_info to edi Joe Perches
@ 2010-04-07 20:25 ` Doug Thompson
0 siblings, 0 replies; 28+ messages in thread
From: Doug Thompson @ 2010-04-07 20:25 UTC (permalink / raw)
To: Andrew Morton, Joe Perches
Cc: Mark Gross, Doug Thompson, bluesmoke-devel, linux-kernel
--- On Mon, 4/5/10, Joe Perches <joe@perches.com> wrote:
> From: Joe Perches <joe@perches.com>
> Subject: [PATCH 07/11] drivers/edac/e7*_edac.c: Rename dev_info to edi
> To: "Andrew Morton" <akpm@linux-foundation.org>
> Cc: "Mark Gross" <mark.gross@intel.com>, "Doug Thompson" <dougthompson@xmission.com>, bluesmoke-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
> Date: Monday, April 5, 2010, 1:05 PM
> There is a macro called dev_info that
> prints struct device specific
> information. Having variables with the same name can
> be confusing and
> prevents conversion of the macro to a function.
>
> Rename the existing dev_info variables to something else in
> preparation
> to converting the dev_info macro to a function.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Doug Thompson <dougthompson@xmission.com>
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 08/11] drivers/staging/iio: Rename dev_info to idi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (6 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 07/11] drivers/edac/e7*_edac.c: Rename dev_info to edi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-05 19:05 ` [PATCH 09/11] pvrusb2-v4l2: Rename dev_info to pdi Joe Perches
` (2 subsequent siblings)
10 siblings, 0 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: Greg Kroah-Hartman, devel, linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/staging/iio/accel/lis3l02dq_core.c | 4 +-
drivers/staging/iio/accel/lis3l02dq_ring.c | 20 ++--
drivers/staging/iio/accel/sca3000_core.c | 24 ++--
drivers/staging/iio/adc/max1363_core.c | 36 ++--
drivers/staging/iio/adc/max1363_ring.c | 6 +-
drivers/staging/iio/chrdev.h | 2 +-
drivers/staging/iio/iio.h | 54 ++++----
drivers/staging/iio/industrialio-core.c | 232 ++++++++++++++--------------
drivers/staging/iio/industrialio-ring.c | 38 +++---
drivers/staging/iio/industrialio-trigger.c | 34 ++--
drivers/staging/iio/ring_generic.h | 4 +-
drivers/staging/iio/trigger_consumer.h | 16 +-
12 files changed, 235 insertions(+), 235 deletions(-)
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index f008837..90c99b7 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -596,12 +596,12 @@ error_mutex_unlock:
}
-static int lis3l02dq_thresh_handler_th(struct iio_dev *dev_info,
+static int lis3l02dq_thresh_handler_th(struct iio_dev *idi,
int index,
s64 timestamp,
int no_test)
{
- struct lis3l02dq_state *st = dev_info->dev_data;
+ struct lis3l02dq_state *st = idi->dev_data;
/* Stash the timestamp somewhere convenient for the bh */
st->last_timestamp = timestamp;
diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c
index a6b7c72..7dc5c6a 100644
--- a/drivers/staging/iio/accel/lis3l02dq_ring.c
+++ b/drivers/staging/iio/accel/lis3l02dq_ring.c
@@ -119,12 +119,12 @@ static void lis3l02dq_poll_func_th(struct iio_dev *indio_dev)
/**
* lis3l02dq_data_rdy_trig_poll() the event handler for the data rdy trig
**/
-static int lis3l02dq_data_rdy_trig_poll(struct iio_dev *dev_info,
+static int lis3l02dq_data_rdy_trig_poll(struct iio_dev *idi,
int index,
s64 timestamp,
int no_test)
{
- struct lis3l02dq_state *st = iio_dev_get_devdata(dev_info);
+ struct lis3l02dq_state *st = iio_dev_get_devdata(idi);
struct iio_trigger *trig = st->trig;
trig->timestamp = timestamp;
@@ -146,31 +146,31 @@ ssize_t lis3l02dq_read_accel_from_ring(struct device *dev,
struct iio_scan_el *el = NULL;
int ret, len = 0, i = 0;
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
- struct iio_dev *dev_info = dev_get_drvdata(dev);
+ struct iio_dev *idi = dev_get_drvdata(dev);
s16 *data;
- while (dev_info->scan_el_attrs->attrs[i]) {
+ while (idi->scan_el_attrs->attrs[i]) {
el = to_iio_scan_el((struct device_attribute *)
- (dev_info->scan_el_attrs->attrs[i]));
+ (idi->scan_el_attrs->attrs[i]));
/* label is in fact the address */
if (el->label == this_attr->address)
break;
i++;
}
- if (!dev_info->scan_el_attrs->attrs[i]) {
+ if (!idi->scan_el_attrs->attrs[i]) {
ret = -EINVAL;
goto error_ret;
}
/* If this element is in the scan mask */
- ret = iio_scan_mask_query(dev_info, el->number);
+ ret = iio_scan_mask_query(idi, el->number);
if (ret < 0)
goto error_ret;
if (ret) {
- data = kmalloc(dev_info->ring->access.get_bpd(dev_info->ring),
+ data = kmalloc(idi->ring->access.get_bpd(idi->ring),
GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
- ret = dev_info->ring->access.read_last(dev_info->ring,
+ ret = idi->ring->access.read_last(idi->ring,
(u8 *)data);
if (ret)
goto error_free_data;
@@ -178,7 +178,7 @@ ssize_t lis3l02dq_read_accel_from_ring(struct device *dev,
ret = -EINVAL;
goto error_ret;
}
- len = iio_scan_mask_count_to_right(dev_info, el->number);
+ len = iio_scan_mask_count_to_right(idi, el->number);
if (len < 0) {
ret = len;
goto error_free_data;
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index cedcaa2..6840d29 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -331,8 +331,8 @@ static ssize_t sca3000_show_name(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct sca3000_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct sca3000_state *st = idi->dev_data;
return sprintf(buf, "%s\n", st->info->name);
}
/**
@@ -343,8 +343,8 @@ static ssize_t sca3000_show_rev(struct device *dev,
char *buf)
{
int len = 0, ret;
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct sca3000_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct sca3000_state *st = idi->dev_data;
u8 *rx;
@@ -375,8 +375,8 @@ sca3000_show_available_measurement_modes(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct sca3000_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct sca3000_state *st = idi->dev_data;
int len = 0;
len += sprintf(buf + len, "0 - normal mode");
@@ -407,8 +407,8 @@ sca3000_show_measurement_mode(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct sca3000_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct sca3000_state *st = idi->dev_data;
int len = 0, ret;
u8 *rx;
@@ -459,8 +459,8 @@ sca3000_store_measurement_mode(struct device *dev,
const char *buf,
size_t len)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct sca3000_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct sca3000_state *st = idi->dev_data;
int ret;
u8 *rx;
int mask = 0x03;
@@ -886,12 +886,12 @@ done:
* These devices deploy unified interrupt status registers meaning
* all interrupts must be handled together
**/
-static int sca3000_handler_th(struct iio_dev *dev_info,
+static int sca3000_handler_th(struct iio_dev *idi,
int index,
s64 timestamp,
int no_test)
{
- struct sca3000_state *st = dev_info->dev_data;
+ struct sca3000_state *st = idi->dev_data;
st->last_timestamp = timestamp;
schedule_work(&st->interrupt_handler_ws);
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c
index 9703881..ed7330c 100644
--- a/drivers/staging/iio/adc/max1363_core.c
+++ b/drivers/staging/iio/adc/max1363_core.c
@@ -321,8 +321,8 @@ static ssize_t max1363_show_av_scan_modes(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct max1363_state *st = idi->dev_data;
int i, len = 0;
for (i = 0; i < st->chip_info->num_modes; i++)
@@ -340,8 +340,8 @@ static ssize_t max1363_scan_direct(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct max1363_state *st = idi->dev_data;
int len = 0, ret, i;
struct i2c_client *client = st->client;
char *rxbuf;
@@ -372,15 +372,15 @@ static ssize_t max1363_scan(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
+ struct iio_dev *idi = dev_get_drvdata(dev);
int ret;
- mutex_lock(&dev_info->mlock);
- if (dev_info->currentmode == INDIO_RING_TRIGGERED)
+ mutex_lock(&idi->mlock);
+ if (idi->currentmode == INDIO_RING_TRIGGERED)
ret = max1363_scan_from_ring(dev, attr, buf);
else
ret = max1363_scan_direct(dev, attr, buf);
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&idi->mlock);
return ret;
}
@@ -390,8 +390,8 @@ static ssize_t max1363_show_scan_mode(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct max1363_state *st = idi->dev_data;
return sprintf(buf, "%s\n", st->current_mode->name);
}
@@ -413,15 +413,15 @@ static ssize_t max1363_store_scan_mode(struct device *dev,
const char *buf,
size_t len)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct max1363_state *st = idi->dev_data;
const struct max1363_mode *new_mode;
int ret;
- mutex_lock(&dev_info->mlock);
+ mutex_lock(&idi->mlock);
new_mode = NULL;
/* Avoid state changes if a ring buffer is enabled */
- if (!iio_ring_enabled(dev_info)) {
+ if (!iio_ring_enabled(idi)) {
new_mode
= __max1363_find_mode_in_ci(st->chip_info, buf);
if (!new_mode) {
@@ -436,12 +436,12 @@ static ssize_t max1363_store_scan_mode(struct device *dev,
ret = -EBUSY;
goto error_ret;
}
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&idi->mlock);
return len;
error_ret:
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&idi->mlock);
return ret;
}
@@ -457,8 +457,8 @@ static ssize_t max1363_show_name(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct max1363_state *st = idi->dev_data;
return sprintf(buf, "%s\n", st->chip_info->name);
}
diff --git a/drivers/staging/iio/adc/max1363_ring.c b/drivers/staging/iio/adc/max1363_ring.c
index a953eac..1eae626 100644
--- a/drivers/staging/iio/adc/max1363_ring.c
+++ b/drivers/staging/iio/adc/max1363_ring.c
@@ -29,8 +29,8 @@ ssize_t max1363_scan_from_ring(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *info = dev_info->dev_data;
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct max1363_state *info = idi->dev_data;
int i, ret, len = 0;
char *ring_data;
@@ -39,7 +39,7 @@ ssize_t max1363_scan_from_ring(struct device *dev,
ret = -ENOMEM;
goto error_ret;
}
- ret = dev_info->ring->access.read_last(dev_info->ring, ring_data);
+ ret = idi->ring->access.read_last(idi->ring, ring_data);
if (ret)
goto error_free_ring_data;
len += sprintf(buf+len, "ring ");
diff --git a/drivers/staging/iio/chrdev.h b/drivers/staging/iio/chrdev.h
index f42bafb..318a30b 100644
--- a/drivers/staging/iio/chrdev.h
+++ b/drivers/staging/iio/chrdev.h
@@ -113,7 +113,7 @@ struct iio_event_handler_list {
struct list_head list;
int refcount;
struct mutex exist_lock;
- int (*handler)(struct iio_dev *dev_info, int index, s64 timestamp,
+ int (*handler)(struct iio_dev *idi, int index, s64 timestamp,
int no_test);
};
diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
index 71dbfe1..f6c4f5a 100644
--- a/drivers/staging/iio/iio.h
+++ b/drivers/staging/iio/iio.h
@@ -134,38 +134,38 @@ struct iio_dev {
*/
#define IIO_MAX_SCAN_LENGTH 15
-static inline int iio_scan_mask_query(struct iio_dev *dev_info, int bit)
+static inline int iio_scan_mask_query(struct iio_dev *idi, int bit)
{
if (bit > IIO_MAX_SCAN_LENGTH)
return -EINVAL;
else
- return !!(dev_info->scan_mask & (1 << bit));
+ return !!(idi->scan_mask & (1 << bit));
};
-static inline int iio_scan_mask_set(struct iio_dev *dev_info, int bit)
+static inline int iio_scan_mask_set(struct iio_dev *idi, int bit)
{
if (bit > IIO_MAX_SCAN_LENGTH)
return -EINVAL;
- dev_info->scan_mask |= (1 << bit);
- dev_info->scan_count++;
+ idi->scan_mask |= (1 << bit);
+ idi->scan_count++;
return 0;
};
-static inline int iio_scan_mask_clear(struct iio_dev *dev_info, int bit)
+static inline int iio_scan_mask_clear(struct iio_dev *idi, int bit)
{
if (bit > IIO_MAX_SCAN_LENGTH)
return -EINVAL;
- dev_info->scan_mask &= ~(1 << bit);
- dev_info->scan_count--;
+ idi->scan_mask &= ~(1 << bit);
+ idi->scan_count--;
return 0;
};
/**
* iio_scan_mask_count_to_right() - how many scan elements occur before here
- * @dev_info: the iio_device whose scan mode we are querying
+ * @idi: the iio_device whose scan mode we are querying
* @bit: which number scan element is this
**/
-static inline int iio_scan_mask_count_to_right(struct iio_dev *dev_info,
+static inline int iio_scan_mask_count_to_right(struct iio_dev *idi,
int bit)
{
int count = 0;
@@ -174,7 +174,7 @@ static inline int iio_scan_mask_count_to_right(struct iio_dev *dev_info,
return -EINVAL;
while (mask) {
mask >>= 1;
- if (mask & dev_info->scan_mask)
+ if (mask & idi->scan_mask)
count++;
}
@@ -183,20 +183,20 @@ static inline int iio_scan_mask_count_to_right(struct iio_dev *dev_info,
/**
* iio_device_register() - register a device with the IIO subsystem
- * @dev_info: Device structure filled by the device driver
+ * @idi: Device structure filled by the device driver
**/
-int iio_device_register(struct iio_dev *dev_info);
+int iio_device_register(struct iio_dev *idi);
/**
* iio_device_unregister() - unregister a device from the IIO subsystem
- * @dev_info: Device structure representing the device.
+ * @idi: Device structure representing the device.
**/
-void iio_device_unregister(struct iio_dev *dev_info);
+void iio_device_unregister(struct iio_dev *idi);
/**
* struct iio_interrupt - wrapper used to allow easy handling of multiple
* physical interrupt lines
- * @dev_info: the iio device for which the is an interrupt line
+ * @idi: the iio device for which the is an interrupt line
* @line_number: associated line number
* @id: idr allocated unique id number
* @irq: associate interrupt number
@@ -204,7 +204,7 @@ void iio_device_unregister(struct iio_dev *dev_info);
* @ev_list_lock: ensure only one access to list at a time
**/
struct iio_interrupt {
- struct iio_dev *dev_info;
+ struct iio_dev *idi;
int line_number;
int id;
int irq;
@@ -218,30 +218,30 @@ struct iio_interrupt {
* iio_register_interrupt_line() - Tell IIO about interrupt lines
*
* @irq: Typically provided via platform data
- * @dev_info: IIO device info structure for device
+ * @idi: IIO device info structure for device
* @line_number: Which interrupt line of the device is this?
* @type: Interrupt type (e.g. edge triggered etc)
* @name: Identifying name.
**/
int iio_register_interrupt_line(unsigned int irq,
- struct iio_dev *dev_info,
+ struct iio_dev *idi,
int line_number,
unsigned long type,
const char *name);
-void iio_unregister_interrupt_line(struct iio_dev *dev_info,
+void iio_unregister_interrupt_line(struct iio_dev *idi,
int line_number);
/**
* iio_push_event() - try to add event to the list for userspace reading
- * @dev_info: IIO device structure
+ * @idi: IIO device structure
* @ev_line: Which event line (hardware interrupt)
* @ev_code: What event
* @timestamp: When the event occurred
**/
-int iio_push_event(struct iio_dev *dev_info,
+int iio_push_event(struct iio_dev *idi,
int ev_line,
int ev_code,
s64 timestamp);
@@ -328,9 +328,9 @@ void iio_free_ev_int(struct iio_event_interface *ev_int);
/**
* iio_allocate_chrdev() - Allocate a chrdev
* @handler: struct that contains relevant file handling for chrdev
- * @dev_info: iio_dev for which chrdev is being created
+ * @idi: iio_dev for which chrdev is being created
**/
-int iio_allocate_chrdev(struct iio_handler *handler, struct iio_dev *dev_info);
+int iio_allocate_chrdev(struct iio_handler *handler, struct iio_dev *idi);
void iio_deallocate_chrdev(struct iio_handler *handler);
/* Used to distinguish between bipolar and unipolar scan elemenents.
@@ -397,11 +397,11 @@ void iio_device_free_chrdev_minor(int val);
/**
* iio_ring_enabled() - helper function to test if any form of ring is enabled
- * @dev_info: IIO device info structure for device
+ * @idi: IIO device info structure for device
**/
-static inline bool iio_ring_enabled(struct iio_dev *dev_info)
+static inline bool iio_ring_enabled(struct iio_dev *idi)
{
- return dev_info->currentmode
+ return idi->currentmode
& (INDIO_RING_TRIGGERED
| INDIO_RING_HARDWARE_BUFFER);
};
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
index b456dfc..ae5882c 100644
--- a/drivers/staging/iio/industrialio-core.c
+++ b/drivers/staging/iio/industrialio-core.c
@@ -107,12 +107,12 @@ error_ret:
}
EXPORT_SYMBOL(__iio_push_event);
-int iio_push_event(struct iio_dev *dev_info,
+int iio_push_event(struct iio_dev *idi,
int ev_line,
int ev_code,
s64 timestamp)
{
- return __iio_push_event(&dev_info->event_interfaces[ev_line],
+ return __iio_push_event(&idi->event_interfaces[ev_line],
ev_code, timestamp, NULL);
}
EXPORT_SYMBOL(iio_push_event);
@@ -121,7 +121,7 @@ EXPORT_SYMBOL(iio_push_event);
static irqreturn_t iio_interrupt_handler(int irq, void *_int_info)
{
struct iio_interrupt *int_info = _int_info;
- struct iio_dev *dev_info = int_info->dev_info;
+ struct iio_dev *idi = int_info->idi;
struct iio_event_handler_list *p;
s64 time_ns;
unsigned long flags;
@@ -140,11 +140,11 @@ static irqreturn_t iio_interrupt_handler(int irq, void *_int_info)
struct iio_event_handler_list,
list);
/* single event handler - maybe shared */
- p->handler(dev_info, 1, time_ns, !(p->refcount > 1));
+ p->handler(idi, 1, time_ns, !(p->refcount > 1));
} else
list_for_each_entry(p, &int_info->ev_list, list) {
disable_irq_nosync(irq);
- p->handler(dev_info, 1, time_ns, 0);
+ p->handler(idi, 1, time_ns, 0);
}
spin_unlock_irqrestore(&int_info->ev_list_lock, flags);
@@ -163,21 +163,21 @@ static struct iio_interrupt *iio_allocate_interrupt(void)
/* Confirming the validity of supplied irq is left to drivers.*/
int iio_register_interrupt_line(unsigned int irq,
- struct iio_dev *dev_info,
+ struct iio_dev *idi,
int line_number,
unsigned long type,
const char *name)
{
int ret;
- dev_info->interrupts[line_number] = iio_allocate_interrupt();
- if (dev_info->interrupts[line_number] == NULL) {
+ idi->interrupts[line_number] = iio_allocate_interrupt();
+ if (idi->interrupts[line_number] == NULL) {
ret = -ENOMEM;
goto error_ret;
}
- dev_info->interrupts[line_number]->line_number = line_number;
- dev_info->interrupts[line_number]->irq = irq;
- dev_info->interrupts[line_number]->dev_info = dev_info;
+ idi->interrupts[line_number]->line_number = line_number;
+ idi->interrupts[line_number]->irq = irq;
+ idi->interrupts[line_number]->idi = idi;
/* Possibly only request on demand?
* Can see this may complicate the handling of interrupts.
@@ -187,7 +187,7 @@ int iio_register_interrupt_line(unsigned int irq,
&iio_interrupt_handler,
type,
name,
- dev_info->interrupts[line_number]);
+ idi->interrupts[line_number]);
error_ret:
return ret;
@@ -204,13 +204,13 @@ ssize_t iio_read_const_attr(struct device *dev,
EXPORT_SYMBOL(iio_read_const_attr);
/* Before this runs the interrupt generator must have been disabled */
-void iio_unregister_interrupt_line(struct iio_dev *dev_info, int line_number)
+void iio_unregister_interrupt_line(struct iio_dev *idi, int line_number)
{
/* make sure the interrupt handlers are all done */
flush_scheduled_work();
- free_irq(dev_info->interrupts[line_number]->irq,
- dev_info->interrupts[line_number]);
- kfree(dev_info->interrupts[line_number]);
+ free_irq(idi->interrupts[line_number]->irq,
+ idi->interrupts[line_number]);
+ kfree(idi->interrupts[line_number]);
}
EXPORT_SYMBOL(iio_unregister_interrupt_line);
@@ -504,22 +504,22 @@ static void __exit iio_exit(void)
class_unregister(&iio_class);
}
-static int iio_device_register_sysfs(struct iio_dev *dev_info)
+static int iio_device_register_sysfs(struct iio_dev *idi)
{
int ret = 0;
- ret = sysfs_create_group(&dev_info->dev.kobj, dev_info->attrs);
+ ret = sysfs_create_group(&idi->dev.kobj, idi->attrs);
if (ret) {
- dev_err(dev_info->dev.parent,
+ dev_err(idi->dev.parent,
"Failed to register sysfs hooks\n");
goto error_ret;
}
- if (dev_info->scan_el_attrs) {
- ret = sysfs_create_group(&dev_info->dev.kobj,
- dev_info->scan_el_attrs);
+ if (idi->scan_el_attrs) {
+ ret = sysfs_create_group(&idi->dev.kobj,
+ idi->scan_el_attrs);
if (ret)
- dev_err(&dev_info->dev,
+ dev_err(&idi->dev,
"Failed to add sysfs scan els\n");
}
@@ -527,13 +527,13 @@ error_ret:
return ret;
}
-static void iio_device_unregister_sysfs(struct iio_dev *dev_info)
+static void iio_device_unregister_sysfs(struct iio_dev *idi)
{
- if (dev_info->scan_el_attrs)
- sysfs_remove_group(&dev_info->dev.kobj,
- dev_info->scan_el_attrs);
+ if (idi->scan_el_attrs)
+ sysfs_remove_group(&idi->dev.kobj,
+ idi->scan_el_attrs);
- sysfs_remove_group(&dev_info->dev.kobj, dev_info->attrs);
+ sysfs_remove_group(&idi->dev.kobj, idi->attrs);
}
int iio_get_new_idr_val(struct idr *this_idr)
@@ -565,33 +565,33 @@ void iio_free_idr_val(struct idr *this_idr, int id)
}
EXPORT_SYMBOL(iio_free_idr_val);
-static int iio_device_register_id(struct iio_dev *dev_info,
+static int iio_device_register_id(struct iio_dev *idi,
struct idr *this_idr)
{
- dev_info->id = iio_get_new_idr_val(&iio_idr);
- if (dev_info->id < 0)
- return dev_info->id;
+ idi->id = iio_get_new_idr_val(&iio_idr);
+ if (idi->id < 0)
+ return idi->id;
return 0;
}
-static void iio_device_unregister_id(struct iio_dev *dev_info)
+static void iio_device_unregister_id(struct iio_dev *idi)
{
- iio_free_idr_val(&iio_idr, dev_info->id);
+ iio_free_idr_val(&iio_idr, idi->id);
}
-static inline int __iio_add_event_config_attrs(struct iio_dev *dev_info, int i)
+static inline int __iio_add_event_config_attrs(struct iio_dev *idi, int i)
{
int ret;
/*p for adding, q for removing */
struct attribute **attrp, **attrq;
- if (dev_info->event_conf_attrs && dev_info->event_conf_attrs[i].attrs) {
- attrp = dev_info->event_conf_attrs[i].attrs;
+ if (idi->event_conf_attrs && idi->event_conf_attrs[i].attrs) {
+ attrp = idi->event_conf_attrs[i].attrs;
while (*attrp) {
- ret = sysfs_add_file_to_group(&dev_info->dev.kobj,
+ ret = sysfs_add_file_to_group(&idi->dev.kobj,
*attrp,
- dev_info
+ idi
->event_attrs[i].name);
if (ret)
goto error_ret;
@@ -601,29 +601,29 @@ static inline int __iio_add_event_config_attrs(struct iio_dev *dev_info, int i)
return 0;
error_ret:
- attrq = dev_info->event_conf_attrs[i].attrs;
+ attrq = idi->event_conf_attrs[i].attrs;
while (attrq != attrp) {
- sysfs_remove_file_from_group(&dev_info->dev.kobj,
+ sysfs_remove_file_from_group(&idi->dev.kobj,
*attrq,
- dev_info->event_attrs[i].name);
+ idi->event_attrs[i].name);
attrq++;
}
return ret;
}
-static inline int __iio_remove_event_config_attrs(struct iio_dev *dev_info,
+static inline int __iio_remove_event_config_attrs(struct iio_dev *idi,
int i)
{
struct attribute **attrq;
- if (dev_info->event_conf_attrs
- && dev_info->event_conf_attrs[i].attrs) {
- attrq = dev_info->event_conf_attrs[i].attrs;
+ if (idi->event_conf_attrs
+ && idi->event_conf_attrs[i].attrs) {
+ attrq = idi->event_conf_attrs[i].attrs;
while (*attrq) {
- sysfs_remove_file_from_group(&dev_info->dev.kobj,
+ sysfs_remove_file_from_group(&idi->dev.kobj,
*attrq,
- dev_info
+ idi
->event_attrs[i].name);
attrq++;
}
@@ -632,74 +632,74 @@ static inline int __iio_remove_event_config_attrs(struct iio_dev *dev_info,
return 0;
}
-static int iio_device_register_eventset(struct iio_dev *dev_info)
+static int iio_device_register_eventset(struct iio_dev *idi)
{
int ret = 0, i, j;
- if (dev_info->num_interrupt_lines == 0)
+ if (idi->num_interrupt_lines == 0)
return 0;
- dev_info->event_interfaces =
+ idi->event_interfaces =
kzalloc(sizeof(struct iio_event_interface)
- *dev_info->num_interrupt_lines,
+ *idi->num_interrupt_lines,
GFP_KERNEL);
- if (dev_info->event_interfaces == NULL) {
+ if (idi->event_interfaces == NULL) {
ret = -ENOMEM;
goto error_ret;
}
- dev_info->interrupts = kzalloc(sizeof(struct iio_interrupt *)
- *dev_info->num_interrupt_lines,
+ idi->interrupts = kzalloc(sizeof(struct iio_interrupt *)
+ *idi->num_interrupt_lines,
GFP_KERNEL);
- if (dev_info->interrupts == NULL) {
+ if (idi->interrupts == NULL) {
ret = -ENOMEM;
goto error_free_event_interfaces;
}
- for (i = 0; i < dev_info->num_interrupt_lines; i++) {
- dev_info->event_interfaces[i].owner = dev_info->driver_module;
+ for (i = 0; i < idi->num_interrupt_lines; i++) {
+ idi->event_interfaces[i].owner = idi->driver_module;
ret = iio_get_new_idr_val(&iio_event_idr);
if (ret)
goto error_free_setup_ev_ints;
else
- dev_info->event_interfaces[i].id = ret;
+ idi->event_interfaces[i].id = ret;
- snprintf(dev_info->event_interfaces[i]._name, 20,
+ snprintf(idi->event_interfaces[i]._name, 20,
"event_line%d",
- dev_info->event_interfaces[i].id);
+ idi->event_interfaces[i].id);
- ret = iio_setup_ev_int(&dev_info->event_interfaces[i],
- (const char *)(dev_info
+ ret = iio_setup_ev_int(&idi->event_interfaces[i],
+ (const char *)(idi
->event_interfaces[i]
._name),
- dev_info->driver_module,
- &dev_info->dev);
+ idi->driver_module,
+ &idi->dev);
if (ret) {
- dev_err(&dev_info->dev,
+ dev_err(&idi->dev,
"Could not get chrdev interface\n");
iio_free_idr_val(&iio_event_idr,
- dev_info->event_interfaces[i].id);
+ idi->event_interfaces[i].id);
goto error_free_setup_ev_ints;
}
}
- for (i = 0; i < dev_info->num_interrupt_lines; i++) {
- snprintf(dev_info->event_interfaces[i]._attrname, 20,
+ for (i = 0; i < idi->num_interrupt_lines; i++) {
+ snprintf(idi->event_interfaces[i]._attrname, 20,
"event_line%d_sources", i);
- dev_info->event_attrs[i].name
+ idi->event_attrs[i].name
= (const char *)
- (dev_info->event_interfaces[i]._attrname);
- ret = sysfs_create_group(&dev_info->dev.kobj,
- &dev_info->event_attrs[i]);
+ (idi->event_interfaces[i]._attrname);
+ ret = sysfs_create_group(&idi->dev.kobj,
+ &idi->event_attrs[i]);
if (ret) {
- dev_err(&dev_info->dev,
+ dev_err(&idi->dev,
"Failed to register sysfs for event attrs");
goto error_remove_sysfs_interfaces;
}
}
- for (i = 0; i < dev_info->num_interrupt_lines; i++) {
- ret = __iio_add_event_config_attrs(dev_info, i);
+ for (i = 0; i < idi->num_interrupt_lines; i++) {
+ ret = __iio_add_event_config_attrs(idi, i);
if (ret)
goto error_unregister_config_attrs;
}
@@ -708,44 +708,44 @@ static int iio_device_register_eventset(struct iio_dev *dev_info)
error_unregister_config_attrs:
for (j = 0; j < i; j++)
- __iio_remove_event_config_attrs(dev_info, i);
- i = dev_info->num_interrupt_lines - 1;
+ __iio_remove_event_config_attrs(idi, i);
+ i = idi->num_interrupt_lines - 1;
error_remove_sysfs_interfaces:
for (j = 0; j < i; j++)
- sysfs_remove_group(&dev_info->dev.kobj,
- &dev_info->event_attrs[j]);
- i = dev_info->num_interrupt_lines - 1;
+ sysfs_remove_group(&idi->dev.kobj,
+ &idi->event_attrs[j]);
+ i = idi->num_interrupt_lines - 1;
error_free_setup_ev_ints:
for (j = 0; j < i; j++) {
iio_free_idr_val(&iio_event_idr,
- dev_info->event_interfaces[i].id);
- iio_free_ev_int(&dev_info->event_interfaces[j]);
+ idi->event_interfaces[i].id);
+ iio_free_ev_int(&idi->event_interfaces[j]);
}
- kfree(dev_info->interrupts);
+ kfree(idi->interrupts);
error_free_event_interfaces:
- kfree(dev_info->event_interfaces);
+ kfree(idi->event_interfaces);
error_ret:
return ret;
}
-static void iio_device_unregister_eventset(struct iio_dev *dev_info)
+static void iio_device_unregister_eventset(struct iio_dev *idi)
{
int i;
- if (dev_info->num_interrupt_lines == 0)
+ if (idi->num_interrupt_lines == 0)
return;
- for (i = 0; i < dev_info->num_interrupt_lines; i++)
- sysfs_remove_group(&dev_info->dev.kobj,
- &dev_info->event_attrs[i]);
+ for (i = 0; i < idi->num_interrupt_lines; i++)
+ sysfs_remove_group(&idi->dev.kobj,
+ &idi->event_attrs[i]);
- for (i = 0; i < dev_info->num_interrupt_lines; i++) {
+ for (i = 0; i < idi->num_interrupt_lines; i++) {
iio_free_idr_val(&iio_event_idr,
- dev_info->event_interfaces[i].id);
- iio_free_ev_int(&dev_info->event_interfaces[i]);
+ idi->event_interfaces[i].id);
+ iio_free_ev_int(&idi->event_interfaces[i]);
}
- kfree(dev_info->interrupts);
- kfree(dev_info->event_interfaces);
+ kfree(idi->interrupts);
+ kfree(idi->event_interfaces);
}
static void iio_dev_release(struct device *device)
@@ -785,56 +785,56 @@ void iio_free_device(struct iio_dev *dev)
}
EXPORT_SYMBOL(iio_free_device);
-int iio_device_register(struct iio_dev *dev_info)
+int iio_device_register(struct iio_dev *idi)
{
int ret;
- ret = iio_device_register_id(dev_info, &iio_idr);
+ ret = iio_device_register_id(idi, &iio_idr);
if (ret) {
- dev_err(&dev_info->dev, "Failed to get id\n");
+ dev_err(&idi->dev, "Failed to get id\n");
goto error_ret;
}
- dev_set_name(&dev_info->dev, "device%d", dev_info->id);
+ dev_set_name(&idi->dev, "device%d", idi->id);
- ret = device_add(&dev_info->dev);
+ ret = device_add(&idi->dev);
if (ret)
goto error_free_idr;
- ret = iio_device_register_sysfs(dev_info);
+ ret = iio_device_register_sysfs(idi);
if (ret) {
- dev_err(dev_info->dev.parent,
+ dev_err(idi->dev.parent,
"Failed to register sysfs interfaces\n");
goto error_del_device;
}
- ret = iio_device_register_eventset(dev_info);
+ ret = iio_device_register_eventset(idi);
if (ret) {
- dev_err(dev_info->dev.parent,
+ dev_err(idi->dev.parent,
"Failed to register event set \n");
goto error_free_sysfs;
}
- if (dev_info->modes & INDIO_RING_TRIGGERED)
- iio_device_register_trigger_consumer(dev_info);
+ if (idi->modes & INDIO_RING_TRIGGERED)
+ iio_device_register_trigger_consumer(idi);
return 0;
error_free_sysfs:
- iio_device_unregister_sysfs(dev_info);
+ iio_device_unregister_sysfs(idi);
error_del_device:
- device_del(&dev_info->dev);
+ device_del(&idi->dev);
error_free_idr:
- iio_device_unregister_id(dev_info);
+ iio_device_unregister_id(idi);
error_ret:
return ret;
}
EXPORT_SYMBOL(iio_device_register);
-void iio_device_unregister(struct iio_dev *dev_info)
+void iio_device_unregister(struct iio_dev *idi)
{
- if (dev_info->modes & INDIO_RING_TRIGGERED)
- iio_device_unregister_trigger_consumer(dev_info);
- iio_device_unregister_eventset(dev_info);
- iio_device_unregister_sysfs(dev_info);
- iio_device_unregister_id(dev_info);
- device_unregister(&dev_info->dev);
+ if (idi->modes & INDIO_RING_TRIGGERED)
+ iio_device_unregister_trigger_consumer(idi);
+ iio_device_unregister_eventset(idi);
+ iio_device_unregister_sysfs(idi);
+ iio_device_unregister_id(idi);
+ device_unregister(&idi->dev);
}
EXPORT_SYMBOL(iio_device_unregister);
diff --git a/drivers/staging/iio/industrialio-ring.c b/drivers/staging/iio/industrialio-ring.c
index ebe5ccc..345ece1 100644
--- a/drivers/staging/iio/industrialio-ring.c
+++ b/drivers/staging/iio/industrialio-ring.c
@@ -258,11 +258,11 @@ static void __iio_free_ring_buffer_access_chrdev(struct iio_ring_buffer *buf)
}
void iio_ring_buffer_init(struct iio_ring_buffer *ring,
- struct iio_dev *dev_info)
+ struct iio_dev *idi)
{
if (ring->access.mark_param_change)
ring->access.mark_param_change(ring);
- ring->indio_dev = dev_info;
+ ring->indio_dev = idi;
ring->ev_int.private = ring;
ring->access_handler.private = ring;
}
@@ -382,10 +382,10 @@ ssize_t iio_store_ring_enable(struct device *dev,
bool requested_state, current_state;
int previous_mode;
struct iio_ring_buffer *ring = dev_get_drvdata(dev);
- struct iio_dev *dev_info = ring->indio_dev;
+ struct iio_dev *idi = ring->indio_dev;
- mutex_lock(&dev_info->mlock);
- previous_mode = dev_info->currentmode;
+ mutex_lock(&idi->mlock);
+ previous_mode = idi->currentmode;
requested_state = !(buf[0] == '0');
current_state = !!(previous_mode & INDIO_ALL_RING_MODES);
if (current_state == requested_state) {
@@ -394,7 +394,7 @@ ssize_t iio_store_ring_enable(struct device *dev,
}
if (requested_state) {
if (ring->preenable) {
- ret = ring->preenable(dev_info);
+ ret = ring->preenable(idi);
if (ret) {
printk(KERN_ERR
"Buffer not started:"
@@ -414,8 +414,8 @@ ssize_t iio_store_ring_enable(struct device *dev,
if (ring->access.mark_in_use)
ring->access.mark_in_use(ring);
/* Definitely possible for devices to support both of these.*/
- if (dev_info->modes & INDIO_RING_TRIGGERED) {
- if (!dev_info->trig) {
+ if (idi->modes & INDIO_RING_TRIGGERED) {
+ if (!idi->trig) {
printk(KERN_INFO
"Buffer not started: no trigger\n");
ret = -EINVAL;
@@ -423,9 +423,9 @@ ssize_t iio_store_ring_enable(struct device *dev,
ring->access.unmark_in_use(ring);
goto error_ret;
}
- dev_info->currentmode = INDIO_RING_TRIGGERED;
- } else if (dev_info->modes & INDIO_RING_HARDWARE_BUFFER)
- dev_info->currentmode = INDIO_RING_HARDWARE_BUFFER;
+ idi->currentmode = INDIO_RING_TRIGGERED;
+ } else if (idi->modes & INDIO_RING_HARDWARE_BUFFER)
+ idi->currentmode = INDIO_RING_HARDWARE_BUFFER;
else { /* should never be reached */
ret = -EINVAL;
goto error_ret;
@@ -433,40 +433,40 @@ ssize_t iio_store_ring_enable(struct device *dev,
if (ring->postenable) {
- ret = ring->postenable(dev_info);
+ ret = ring->postenable(idi);
if (ret) {
printk(KERN_INFO
"Buffer not started:"
"postenable failed\n");
if (ring->access.unmark_in_use)
ring->access.unmark_in_use(ring);
- dev_info->currentmode = previous_mode;
+ idi->currentmode = previous_mode;
if (ring->postdisable)
- ring->postdisable(dev_info);
+ ring->postdisable(idi);
goto error_ret;
}
}
} else {
if (ring->predisable) {
- ret = ring->predisable(dev_info);
+ ret = ring->predisable(idi);
if (ret)
goto error_ret;
}
if (ring->access.unmark_in_use)
ring->access.unmark_in_use(ring);
- dev_info->currentmode = INDIO_DIRECT_MODE;
+ idi->currentmode = INDIO_DIRECT_MODE;
if (ring->postdisable) {
- ret = ring->postdisable(dev_info);
+ ret = ring->postdisable(idi);
if (ret)
goto error_ret;
}
}
done:
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&idi->mlock);
return len;
error_ret:
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&idi->mlock);
return ret;
}
EXPORT_SYMBOL(iio_store_ring_enable);
diff --git a/drivers/staging/iio/industrialio-trigger.c b/drivers/staging/iio/industrialio-trigger.c
index 693ebc4..8f33535 100644
--- a/drivers/staging/iio/industrialio-trigger.c
+++ b/drivers/staging/iio/industrialio-trigger.c
@@ -288,13 +288,13 @@ static ssize_t iio_trigger_read_current(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
+ struct iio_dev *idi = dev_get_drvdata(dev);
int len = 0;
- if (dev_info->trig)
+ if (idi->trig)
len = snprintf(buf,
IIO_TRIGGER_NAME_LENGTH,
"%s\n",
- dev_info->trig->name);
+ idi->trig->name);
return len;
}
@@ -310,22 +310,22 @@ static ssize_t iio_trigger_write_current(struct device *dev,
const char *buf,
size_t len)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct iio_trigger *oldtrig = dev_info->trig;
- mutex_lock(&dev_info->mlock);
- if (dev_info->currentmode == INDIO_RING_TRIGGERED) {
- mutex_unlock(&dev_info->mlock);
+ struct iio_dev *idi = dev_get_drvdata(dev);
+ struct iio_trigger *oldtrig = idi->trig;
+ mutex_lock(&idi->mlock);
+ if (idi->currentmode == INDIO_RING_TRIGGERED) {
+ mutex_unlock(&idi->mlock);
return -EBUSY;
}
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&idi->mlock);
len = len < IIO_TRIGGER_NAME_LENGTH ? len : IIO_TRIGGER_NAME_LENGTH;
- dev_info->trig = iio_trigger_find_by_name(buf, len);
- if (oldtrig && dev_info->trig != oldtrig)
+ idi->trig = iio_trigger_find_by_name(buf, len);
+ if (oldtrig && idi->trig != oldtrig)
iio_put_trigger(oldtrig);
- if (dev_info->trig)
- iio_get_trigger(dev_info->trig);
+ if (idi->trig)
+ iio_get_trigger(idi->trig);
return len;
}
@@ -380,18 +380,18 @@ void iio_free_trigger(struct iio_trigger *trig)
}
EXPORT_SYMBOL(iio_free_trigger);
-int iio_device_register_trigger_consumer(struct iio_dev *dev_info)
+int iio_device_register_trigger_consumer(struct iio_dev *idi)
{
int ret;
- ret = sysfs_create_group(&dev_info->dev.kobj,
+ ret = sysfs_create_group(&idi->dev.kobj,
&iio_trigger_consumer_attr_group);
return ret;
}
EXPORT_SYMBOL(iio_device_register_trigger_consumer);
-int iio_device_unregister_trigger_consumer(struct iio_dev *dev_info)
+int iio_device_unregister_trigger_consumer(struct iio_dev *idi)
{
- sysfs_remove_group(&dev_info->dev.kobj,
+ sysfs_remove_group(&idi->dev.kobj,
&iio_trigger_consumer_attr_group);
return 0;
}
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
index 09044ad..6da8bae 100644
--- a/drivers/staging/iio/ring_generic.h
+++ b/drivers/staging/iio/ring_generic.h
@@ -131,7 +131,7 @@ struct iio_ring_buffer {
};
void iio_ring_buffer_init(struct iio_ring_buffer *ring,
- struct iio_dev *dev_info);
+ struct iio_dev *idi);
/**
* __iio_init_ring_buffer() - initialize common elements of ring buffers
@@ -166,7 +166,7 @@ struct iio_scan_el {
unsigned int label;
int (*set_state)(struct iio_scan_el *scanel,
- struct iio_dev *dev_info,
+ struct iio_dev *idi,
bool state);
};
diff --git a/drivers/staging/iio/trigger_consumer.h b/drivers/staging/iio/trigger_consumer.h
index 9d52d96..944d562 100644
--- a/drivers/staging/iio/trigger_consumer.h
+++ b/drivers/staging/iio/trigger_consumer.h
@@ -11,32 +11,32 @@
#ifdef CONFIG_IIO_TRIGGER
/**
* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
- * @dev_info: iio_dev associated with the device that will consume the trigger
+ * @idi: iio_dev associated with the device that will consume the trigger
**/
-int iio_device_register_trigger_consumer(struct iio_dev *dev_info);
+int iio_device_register_trigger_consumer(struct iio_dev *idi);
/**
* iio_device_unregister_trigger_consumer() - reverse the registration process
- * @dev_info: iio_dev associated with the device that consumed the trigger
+ * @idi: iio_dev associated with the device that consumed the trigger
**/
-int iio_device_unregister_trigger_consumer(struct iio_dev *dev_info);
+int iio_device_unregister_trigger_consumer(struct iio_dev *idi);
#else
/**
* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
- * @dev_info: iio_dev associated with the device that will consume the trigger
+ * @idi: iio_dev associated with the device that will consume the trigger
**/
-static int iio_device_register_trigger_consumer(struct iio_dev *dev_info)
+static int iio_device_register_trigger_consumer(struct iio_dev *idi)
{
return 0;
};
/**
* iio_device_unregister_trigger_consumer() - reverse the registration process
- * @dev_info: iio_dev associated with the device that consumed the trigger
+ * @idi: iio_dev associated with the device that consumed the trigger
**/
-static int iio_device_unregister_trigger_consumer(struct iio_dev *dev_info)
+static int iio_device_unregister_trigger_consumer(struct iio_dev *idi)
{
return 0;
};
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* [PATCH 09/11] pvrusb2-v4l2: Rename dev_info to pdi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (7 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 08/11] drivers/staging/iio: Rename dev_info to idi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-10 16:57 ` Mike Isely
2010-04-05 19:05 ` [PATCH 10/11] drivers/char/mem.c: Rename dev_info to bdi Joe Perches
2010-04-05 19:05 ` [PATCH 11/11] drivers/uwb: Rename dev_info to wdi Joe Perches
10 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton
Cc: Mike Isely, Mauro Carvalho Chehab, linux-media, linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index cc8ddb2..ba32c91 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -48,7 +48,7 @@ struct pvr2_v4l2_dev {
struct pvr2_v4l2_fh {
struct pvr2_channel channel;
- struct pvr2_v4l2_dev *dev_info;
+ struct pvr2_v4l2_dev *pdi;
enum v4l2_priority prio;
struct pvr2_ioread *rhp;
struct file *file;
@@ -161,7 +161,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
{
struct pvr2_v4l2_fh *fh = file->private_data;
struct pvr2_v4l2 *vp = fh->vhead;
- struct pvr2_v4l2_dev *dev_info = fh->dev_info;
+ struct pvr2_v4l2_dev *pdi = fh->pdi;
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
long ret = -EINVAL;
@@ -563,14 +563,14 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
case VIDIOC_STREAMON:
{
- if (!fh->dev_info->stream) {
+ if (!fh->pdi->stream) {
/* No stream defined for this node. This means
that we're not currently allowed to stream from
this node. */
ret = -EPERM;
break;
}
- ret = pvr2_hdw_set_stream_type(hdw,dev_info->config);
+ ret = pvr2_hdw_set_stream_type(hdw,pdi->config);
if (ret < 0) return ret;
ret = pvr2_hdw_set_streaming(hdw,!0);
break;
@@ -578,7 +578,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
case VIDIOC_STREAMOFF:
{
- if (!fh->dev_info->stream) {
+ if (!fh->pdi->stream) {
/* No stream defined for this node. This means
that we're not currently allowed to stream from
this node. */
@@ -1031,7 +1031,7 @@ static int pvr2_v4l2_open(struct file *file)
}
init_waitqueue_head(&fhp->wait_data);
- fhp->dev_info = dip;
+ fhp->pdi = dip;
pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp);
pvr2_channel_init(&fhp->channel,vp->channel.mc_head);
@@ -1112,7 +1112,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
struct pvr2_hdw *hdw;
if (fh->rhp) return 0;
- if (!fh->dev_info->stream) {
+ if (!fh->pdi->stream) {
/* No stream defined for this node. This means that we're
not currently allowed to stream from this node. */
return -EPERM;
@@ -1121,21 +1121,21 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
/* First read() attempt. Try to claim the stream and start
it... */
if ((ret = pvr2_channel_claim_stream(&fh->channel,
- fh->dev_info->stream)) != 0) {
+ fh->pdi->stream)) != 0) {
/* Someone else must already have it */
return ret;
}
- fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream);
+ fh->rhp = pvr2_channel_create_mpeg_stream(fh->pdi->stream);
if (!fh->rhp) {
pvr2_channel_claim_stream(&fh->channel,NULL);
return -ENOMEM;
}
hdw = fh->channel.mc_head->hdw;
- sp = fh->dev_info->stream->stream;
+ sp = fh->pdi->stream->stream;
pvr2_stream_set_callback(sp,(pvr2_stream_callback)pvr2_v4l2_notify,fh);
- pvr2_hdw_set_stream_type(hdw,fh->dev_info->config);
+ pvr2_hdw_set_stream_type(hdw,fh->pdi->config);
if ((ret = pvr2_hdw_set_streaming(hdw,!0)) < 0) return ret;
return pvr2_ioread_set_enabled(fh->rhp,!0);
}
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 09/11] pvrusb2-v4l2: Rename dev_info to pdi
2010-04-05 19:05 ` [PATCH 09/11] pvrusb2-v4l2: Rename dev_info to pdi Joe Perches
@ 2010-04-10 16:57 ` Mike Isely
0 siblings, 0 replies; 28+ messages in thread
From: Mike Isely @ 2010-04-10 16:57 UTC (permalink / raw)
To: Joe Perches
Cc: Andrew Morton, Mauro Carvalho Chehab, linux-media,
Linux Kernel Mailing List, Mike Isely
Acked-By: Mike Isely <isely@pobox.com>
-Mike
On Mon, 5 Apr 2010, Joe Perches wrote:
> There is a macro called dev_info that prints struct device specific
> information. Having variables with the same name can be confusing and
> prevents conversion of the macro to a function.
>
> Rename the existing dev_info variables to something else in preparation
> to converting the dev_info macro to a function.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 22 +++++++++++-----------
> 1 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
> index cc8ddb2..ba32c91 100644
> --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
> +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
> @@ -48,7 +48,7 @@ struct pvr2_v4l2_dev {
>
> struct pvr2_v4l2_fh {
> struct pvr2_channel channel;
> - struct pvr2_v4l2_dev *dev_info;
> + struct pvr2_v4l2_dev *pdi;
> enum v4l2_priority prio;
> struct pvr2_ioread *rhp;
> struct file *file;
> @@ -161,7 +161,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
> {
> struct pvr2_v4l2_fh *fh = file->private_data;
> struct pvr2_v4l2 *vp = fh->vhead;
> - struct pvr2_v4l2_dev *dev_info = fh->dev_info;
> + struct pvr2_v4l2_dev *pdi = fh->pdi;
> struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
> long ret = -EINVAL;
>
> @@ -563,14 +563,14 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
>
> case VIDIOC_STREAMON:
> {
> - if (!fh->dev_info->stream) {
> + if (!fh->pdi->stream) {
> /* No stream defined for this node. This means
> that we're not currently allowed to stream from
> this node. */
> ret = -EPERM;
> break;
> }
> - ret = pvr2_hdw_set_stream_type(hdw,dev_info->config);
> + ret = pvr2_hdw_set_stream_type(hdw,pdi->config);
> if (ret < 0) return ret;
> ret = pvr2_hdw_set_streaming(hdw,!0);
> break;
> @@ -578,7 +578,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
>
> case VIDIOC_STREAMOFF:
> {
> - if (!fh->dev_info->stream) {
> + if (!fh->pdi->stream) {
> /* No stream defined for this node. This means
> that we're not currently allowed to stream from
> this node. */
> @@ -1031,7 +1031,7 @@ static int pvr2_v4l2_open(struct file *file)
> }
>
> init_waitqueue_head(&fhp->wait_data);
> - fhp->dev_info = dip;
> + fhp->pdi = dip;
>
> pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp);
> pvr2_channel_init(&fhp->channel,vp->channel.mc_head);
> @@ -1112,7 +1112,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
> struct pvr2_hdw *hdw;
> if (fh->rhp) return 0;
>
> - if (!fh->dev_info->stream) {
> + if (!fh->pdi->stream) {
> /* No stream defined for this node. This means that we're
> not currently allowed to stream from this node. */
> return -EPERM;
> @@ -1121,21 +1121,21 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh)
> /* First read() attempt. Try to claim the stream and start
> it... */
> if ((ret = pvr2_channel_claim_stream(&fh->channel,
> - fh->dev_info->stream)) != 0) {
> + fh->pdi->stream)) != 0) {
> /* Someone else must already have it */
> return ret;
> }
>
> - fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream);
> + fh->rhp = pvr2_channel_create_mpeg_stream(fh->pdi->stream);
> if (!fh->rhp) {
> pvr2_channel_claim_stream(&fh->channel,NULL);
> return -ENOMEM;
> }
>
> hdw = fh->channel.mc_head->hdw;
> - sp = fh->dev_info->stream->stream;
> + sp = fh->pdi->stream->stream;
> pvr2_stream_set_callback(sp,(pvr2_stream_callback)pvr2_v4l2_notify,fh);
> - pvr2_hdw_set_stream_type(hdw,fh->dev_info->config);
> + pvr2_hdw_set_stream_type(hdw,fh->pdi->config);
> if ((ret = pvr2_hdw_set_streaming(hdw,!0)) < 0) return ret;
> return pvr2_ioread_set_enabled(fh->rhp,!0);
> }
>
--
Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 10/11] drivers/char/mem.c: Rename dev_info to bdi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (8 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 09/11] pvrusb2-v4l2: Rename dev_info to pdi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-05 19:05 ` [PATCH 11/11] drivers/uwb: Rename dev_info to wdi Joe Perches
10 siblings, 0 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/char/mem.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 1f3215a..cb1d642 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -839,7 +839,7 @@ static const struct memdev {
const char *name;
mode_t mode;
const struct file_operations *fops;
- struct backing_dev_info *dev_info;
+ struct backing_dev_info *bdi;
} devlist[] = {
[1] = { "mem", 0, &mem_fops, &directly_mappable_cdev_bdi },
#ifdef CONFIG_DEVKMEM
@@ -873,8 +873,8 @@ static int memory_open(struct inode *inode, struct file *filp)
return -ENXIO;
filp->f_op = dev->fops;
- if (dev->dev_info)
- filp->f_mapping->backing_dev_info = dev->dev_info;
+ if (dev->bdi)
+ filp->f_mapping->backing_dev_info = dev->bdi;
if (dev->fops->open)
return dev->fops->open(inode, filp);
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* [PATCH 11/11] drivers/uwb: Rename dev_info to wdi
2010-04-05 19:05 ` [PATCH 00/11] treewide: rename dev_info variables to something else Joe Perches
` (9 preceding siblings ...)
2010-04-05 19:05 ` [PATCH 10/11] drivers/char/mem.c: Rename dev_info to bdi Joe Perches
@ 2010-04-05 19:05 ` Joe Perches
2010-04-05 21:44 ` Joe Perches
2010-04-05 22:24 ` [PATCH 11/11 v2] " Joe Perches
10 siblings, 2 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 19:05 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Vrabel, netdev, linux-kernel
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/uwb/i1480/i1480u-wlp/lc.c | 16 ++++++------
drivers/uwb/wlp/messages.c | 40 ++++++++++++++++----------------
drivers/uwb/wlp/sysfs.c | 46 ++++++++++++++++++------------------
drivers/uwb/wlp/wlp-lc.c | 12 +++++-----
4 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/drivers/uwb/i1480/i1480u-wlp/lc.c b/drivers/uwb/i1480/i1480u-wlp/lc.c
index f272dfe..bd52675 100644
--- a/drivers/uwb/i1480/i1480u-wlp/lc.c
+++ b/drivers/uwb/i1480/i1480u-wlp/lc.c
@@ -92,28 +92,28 @@ void i1480u_init(struct i1480u *i1480u)
* information elements have intuitive mappings, other not.
*/
static
-void i1480u_fill_device_info(struct wlp *wlp, struct wlp_device_info *dev_info)
+void i1480u_fill_device_info(struct wlp *wlp, struct wlp_device_info *wdi)
{
struct i1480u *i1480u = container_of(wlp, struct i1480u, wlp);
struct usb_device *usb_dev = i1480u->usb_dev;
/* Treat device name and model name the same */
if (usb_dev->descriptor.iProduct) {
usb_string(usb_dev, usb_dev->descriptor.iProduct,
- dev_info->name, sizeof(dev_info->name));
+ wdi->name, sizeof(wdi->name));
usb_string(usb_dev, usb_dev->descriptor.iProduct,
- dev_info->model_name, sizeof(dev_info->model_name));
+ wdi->model_name, sizeof(wdi->model_name));
}
if (usb_dev->descriptor.iManufacturer)
usb_string(usb_dev, usb_dev->descriptor.iManufacturer,
- dev_info->manufacturer,
- sizeof(dev_info->manufacturer));
- scnprintf(dev_info->model_nr, sizeof(dev_info->model_nr), "%04x",
+ wdi->manufacturer,
+ sizeof(wdi->manufacturer));
+ scnprintf(wdi->model_nr, sizeof(wdi->model_nr), "%04x",
__le16_to_cpu(usb_dev->descriptor.bcdDevice));
if (usb_dev->descriptor.iSerialNumber)
usb_string(usb_dev, usb_dev->descriptor.iSerialNumber,
- dev_info->serial, sizeof(dev_info->serial));
+ wdi->serial, sizeof(wdi->serial));
/* FIXME: where should we obtain category? */
- dev_info->prim_dev_type.category = cpu_to_le16(WLP_DEV_CAT_OTHER);
+ wdi->prim_dev_type.category = cpu_to_le16(WLP_DEV_CAT_OTHER);
/* FIXME: Complete OUI and OUIsubdiv attributes */
}
diff --git a/drivers/uwb/wlp/messages.c b/drivers/uwb/wlp/messages.c
index 7516486..4057942 100644
--- a/drivers/uwb/wlp/messages.c
+++ b/drivers/uwb/wlp/messages.c
@@ -712,7 +712,7 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss,
struct sk_buff *_skb;
void *d1_itr;
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0) {
dev_err(dev, "WLP: Unable to setup device "
@@ -720,7 +720,7 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss,
goto error;
}
}
- info = wlp->dev_info;
+ info = wlp->wdi;
_skb = dev_alloc_skb(sizeof(*_d1)
+ sizeof(struct wlp_attr_uuid_e)
+ sizeof(struct wlp_attr_wss_sel_mthd)
@@ -794,7 +794,7 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss,
void *d2_itr;
size_t mem_needed;
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0) {
dev_err(dev, "WLP: Unable to setup device "
@@ -802,7 +802,7 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss,
goto error;
}
}
- info = wlp->dev_info;
+ info = wlp->wdi;
mem_needed = sizeof(*_d2)
+ sizeof(struct wlp_attr_uuid_e)
+ sizeof(struct wlp_attr_uuid_r)
@@ -970,7 +970,7 @@ error_parse:
*/
static
int wlp_get_variable_info(struct wlp *wlp, void *data,
- struct wlp_device_info *dev_info, ssize_t len)
+ struct wlp_device_info *wdi, ssize_t len)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
size_t used = 0;
@@ -993,7 +993,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_manufacturer(wlp, data + used,
- dev_info->manufacturer,
+ wdi->manufacturer,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain "
@@ -1011,7 +1011,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_model_name(wlp, data + used,
- dev_info->model_name,
+ wdi->model_name,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Model "
@@ -1028,7 +1028,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_model_nr(wlp, data + used,
- dev_info->model_nr,
+ wdi->model_nr,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Model "
@@ -1045,7 +1045,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_serial(wlp, data + used,
- dev_info->serial, len - used);
+ wdi->serial, len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Serial "
"number attribute from D1 message.\n");
@@ -1061,7 +1061,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_prim_dev_type(wlp, data + used,
- &dev_info->prim_dev_type,
+ &wdi->prim_dev_type,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Primary "
@@ -1069,10 +1069,10 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
"message.\n");
goto error_parse;
}
- dev_info->prim_dev_type.category =
- le16_to_cpu(dev_info->prim_dev_type.category);
- dev_info->prim_dev_type.subID =
- le16_to_cpu(dev_info->prim_dev_type.subID);
+ wdi->prim_dev_type.category =
+ le16_to_cpu(wdi->prim_dev_type.category);
+ wdi->prim_dev_type.subID =
+ le16_to_cpu(wdi->prim_dev_type.subID);
last = WLP_ATTR_PRI_DEV_TYPE;
used += result;
break;
@@ -1098,7 +1098,7 @@ static
int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
struct wlp_uuid *uuid_e,
enum wlp_wss_sel_mthd *sel_mthd,
- struct wlp_device_info *dev_info,
+ struct wlp_device_info *wdi,
enum wlp_assc_error *assc_err)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
@@ -1123,7 +1123,7 @@ int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
goto error_parse;
}
used += result;
- result = wlp_get_dev_name(wlp, ptr + used, dev_info->name,
+ result = wlp_get_dev_name(wlp, ptr + used, wdi->name,
len - used);
if (result < 0) {
dev_err(dev, "WLP: unable to obtain Device Name from D1 "
@@ -1131,7 +1131,7 @@ int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
goto error_parse;
}
used += result;
- result = wlp_get_variable_info(wlp, ptr + used, dev_info, len - used);
+ result = wlp_get_variable_info(wlp, ptr + used, wdi, len - used);
if (result < 0) {
dev_err(dev, "WLP: unable to obtain Device Information from "
"D1 message.\n");
@@ -1171,15 +1171,15 @@ void wlp_handle_d1_frame(struct work_struct *ws)
struct device *dev = &wlp->rc->uwb_dev.dev;
struct wlp_uuid uuid_e;
enum wlp_wss_sel_mthd sel_mthd = 0;
- struct wlp_device_info dev_info;
+ struct wlp_device_info wdi;
enum wlp_assc_error assc_err;
struct sk_buff *resp = NULL;
/* Parse D1 frame */
mutex_lock(&wss->mutex);
mutex_lock(&wlp->mutex); /* to access wlp->uuid */
- memset(&dev_info, 0, sizeof(dev_info));
- result = wlp_parse_d1_frame(wlp, skb, &uuid_e, &sel_mthd, &dev_info,
+ memset(&wdi, 0, sizeof(wdi));
+ result = wlp_parse_d1_frame(wlp, skb, &uuid_e, &sel_mthd, &wdi,
&assc_err);
if (result < 0) {
dev_err(dev, "WLP: Unable to parse incoming D1 frame.\n");
diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c
index 6627c94..b24751c 100644
--- a/drivers/uwb/wlp/sysfs.c
+++ b/drivers/uwb/wlp/sysfs.c
@@ -333,12 +333,12 @@ ssize_t wlp_dev_##type##_show(struct wlp *wlp, char *buf) \
{ \
ssize_t result = 0; \
mutex_lock(&wlp->mutex); \
- if (wlp->dev_info == NULL) { \
+ if (wlp->wdi == NULL) { \
result = __wlp_setup_device_info(wlp); \
if (result < 0) \
goto out; \
} \
- result = scnprintf(buf, PAGE_SIZE, "%s\n", wlp->dev_info->type);\
+ result = scnprintf(buf, PAGE_SIZE, "%s\n", wlp->wdi->type); \
out: \
mutex_unlock(&wlp->mutex); \
return result; \
@@ -360,14 +360,14 @@ ssize_t wlp_dev_##type##_store(struct wlp *wlp, const char *buf, size_t size)\
ssize_t result; \
char format[10]; \
mutex_lock(&wlp->mutex); \
- if (wlp->dev_info == NULL) { \
+ if (wlp->wdi == NULL) { \
result = __wlp_alloc_device_info(wlp); \
if (result < 0) \
goto out; \
} \
- memset(wlp->dev_info->type, 0, sizeof(wlp->dev_info->type)); \
+ memset(wlp->wdi->type, 0, sizeof(wlp->wdi->type)); \
sprintf(format, "%%%uc", len); \
- result = sscanf(buf, format, wlp->dev_info->type); \
+ result = sscanf(buf, format, wlp->wdi->type); \
out: \
mutex_unlock(&wlp->mutex); \
return result < 0 ? result : size; \
@@ -409,13 +409,13 @@ ssize_t wlp_dev_prim_category_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%s\n",
- wlp_dev_category_str(wlp->dev_info->prim_dev_type.category));
+ wlp_dev_category_str(wlp->wdi->prim_dev_type.category));
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -428,7 +428,7 @@ ssize_t wlp_dev_prim_category_store(struct wlp *wlp, const char *buf,
ssize_t result;
u16 cat;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
@@ -436,7 +436,7 @@ ssize_t wlp_dev_prim_category_store(struct wlp *wlp, const char *buf,
result = sscanf(buf, "%hu", &cat);
if ((cat >= WLP_DEV_CAT_COMPUTER && cat <= WLP_DEV_CAT_TELEPHONE)
|| cat == WLP_DEV_CAT_OTHER)
- wlp->dev_info->prim_dev_type.category = cat;
+ wlp->wdi->prim_dev_type.category = cat;
else
result = -EINVAL;
out:
@@ -449,15 +449,15 @@ ssize_t wlp_dev_prim_OUI_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%02x:%02x:%02x\n",
- wlp->dev_info->prim_dev_type.OUI[0],
- wlp->dev_info->prim_dev_type.OUI[1],
- wlp->dev_info->prim_dev_type.OUI[2]);
+ wlp->wdi->prim_dev_type.OUI[0],
+ wlp->wdi->prim_dev_type.OUI[1],
+ wlp->wdi->prim_dev_type.OUI[2]);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -469,7 +469,7 @@ ssize_t wlp_dev_prim_OUI_store(struct wlp *wlp, const char *buf, size_t size)
ssize_t result;
u8 OUI[3];
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
@@ -480,7 +480,7 @@ ssize_t wlp_dev_prim_OUI_store(struct wlp *wlp, const char *buf, size_t size)
result = -EINVAL;
goto out;
} else
- memcpy(wlp->dev_info->prim_dev_type.OUI, OUI, sizeof(OUI));
+ memcpy(wlp->wdi->prim_dev_type.OUI, OUI, sizeof(OUI));
out:
mutex_unlock(&wlp->mutex);
return result < 0 ? result : size;
@@ -492,13 +492,13 @@ ssize_t wlp_dev_prim_OUI_sub_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%u\n",
- wlp->dev_info->prim_dev_type.OUIsubdiv);
+ wlp->wdi->prim_dev_type.OUIsubdiv);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -512,14 +512,14 @@ ssize_t wlp_dev_prim_OUI_sub_store(struct wlp *wlp, const char *buf,
unsigned sub;
u8 max_sub = ~0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
}
result = sscanf(buf, "%u", &sub);
if (sub <= max_sub)
- wlp->dev_info->prim_dev_type.OUIsubdiv = sub;
+ wlp->wdi->prim_dev_type.OUIsubdiv = sub;
else
result = -EINVAL;
out:
@@ -532,13 +532,13 @@ ssize_t wlp_dev_prim_subcat_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%u\n",
- wlp->dev_info->prim_dev_type.subID);
+ wlp->wdi->prim_dev_type.subID);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -552,14 +552,14 @@ ssize_t wlp_dev_prim_subcat_store(struct wlp *wlp, const char *buf,
unsigned sub;
__le16 max_sub = ~0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
}
result = sscanf(buf, "%u", &sub);
if (sub <= max_sub)
- wlp->dev_info->prim_dev_type.subID = sub;
+ wlp->wdi->prim_dev_type.subID = sub;
else
result = -EINVAL;
out:
diff --git a/drivers/uwb/wlp/wlp-lc.c b/drivers/uwb/wlp/wlp-lc.c
index 13db739..530613e 100644
--- a/drivers/uwb/wlp/wlp-lc.c
+++ b/drivers/uwb/wlp/wlp-lc.c
@@ -39,9 +39,9 @@ void wlp_neighbor_init(struct wlp_neighbor_e *neighbor)
int __wlp_alloc_device_info(struct wlp *wlp)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
- BUG_ON(wlp->dev_info != NULL);
- wlp->dev_info = kzalloc(sizeof(struct wlp_device_info), GFP_KERNEL);
- if (wlp->dev_info == NULL) {
+ BUG_ON(wlp->wdi != NULL);
+ wlp->wdi = kzalloc(sizeof(struct wlp_device_info), GFP_KERNEL);
+ if (wlp->wdi == NULL) {
dev_err(dev, "WLP: Unable to allocate memory for "
"device information.\n");
return -ENOMEM;
@@ -58,7 +58,7 @@ int __wlp_alloc_device_info(struct wlp *wlp)
static
void __wlp_fill_device_info(struct wlp *wlp)
{
- wlp->fill_device_info(wlp, wlp->dev_info);
+ wlp->fill_device_info(wlp, wlp->wdi);
}
/**
@@ -538,8 +538,8 @@ void wlp_remove(struct wlp *wlp)
uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler);
wlp_eda_release(&wlp->eda);
mutex_lock(&wlp->mutex);
- if (wlp->dev_info != NULL)
- kfree(wlp->dev_info);
+ if (wlp->wdi != NULL)
+ kfree(wlp->wdi);
mutex_unlock(&wlp->mutex);
wlp->rc = NULL;
}
--
1.7.0.3.311.g6a6955
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 11/11] drivers/uwb: Rename dev_info to wdi
2010-04-05 19:05 ` [PATCH 11/11] drivers/uwb: Rename dev_info to wdi Joe Perches
@ 2010-04-05 21:44 ` Joe Perches
2010-04-05 21:51 ` David Miller
2010-04-05 22:24 ` [PATCH 11/11 v2] " Joe Perches
1 sibling, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-04-05 21:44 UTC (permalink / raw)
To: Andrew Morton, David Miller; +Cc: David Vrabel, netdev, linux-kernel
On Mon, 2010-04-05 at 12:05 -0700, Joe Perches wrote:
> There is a macro called dev_info that prints struct device specific
> information. Having variables with the same name can be confusing and
> prevents conversion of the macro to a function.
>
> Rename the existing dev_info variables to something else in preparation
> to converting the dev_info macro to a function.
http://patchwork.ozlabs.org/patch/49421/
This marked as RFC in patchwork.
It's not intended to be.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/11] drivers/uwb: Rename dev_info to wdi
2010-04-05 21:44 ` Joe Perches
@ 2010-04-05 21:51 ` David Miller
2010-04-06 12:42 ` David Vrabel
0 siblings, 1 reply; 28+ messages in thread
From: David Miller @ 2010-04-05 21:51 UTC (permalink / raw)
To: joe; +Cc: akpm, david.vrabel, netdev, linux-kernel
From: Joe Perches <joe@perches.com>
Date: Mon, 05 Apr 2010 14:44:18 -0700
> On Mon, 2010-04-05 at 12:05 -0700, Joe Perches wrote:
>> There is a macro called dev_info that prints struct device specific
>> information. Having variables with the same name can be confusing and
>> prevents conversion of the macro to a function.
>>
>> Rename the existing dev_info variables to something else in preparation
>> to converting the dev_info macro to a function.
>
> http://patchwork.ozlabs.org/patch/49421/
>
> This marked as RFC in patchwork.
> It's not intended to be.
Because I can't apply the entire set, I'd like someone else
to take this in since it's not really a networking specific
patch.
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 11/11] drivers/uwb: Rename dev_info to wdi
2010-04-05 21:51 ` David Miller
@ 2010-04-06 12:42 ` David Vrabel
0 siblings, 0 replies; 28+ messages in thread
From: David Vrabel @ 2010-04-06 12:42 UTC (permalink / raw)
To: David Miller; +Cc: joe, akpm, netdev, linux-kernel
David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Mon, 05 Apr 2010 14:44:18 -0700
>
>> On Mon, 2010-04-05 at 12:05 -0700, Joe Perches wrote:
>>> There is a macro called dev_info that prints struct device specific
>>> information. Having variables with the same name can be confusing and
>>> prevents conversion of the macro to a function.
>>>
>>> Rename the existing dev_info variables to something else in preparation
>>> to converting the dev_info macro to a function.
>> http://patchwork.ozlabs.org/patch/49421/
>>
>> This marked as RFC in patchwork.
>> It's not intended to be.
>
> Because I can't apply the entire set, I'd like someone else
> to take this in since it's not really a networking specific
> patch.
I've taken it.
David
--
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 11/11 v2] drivers/uwb: Rename dev_info to wdi
2010-04-05 19:05 ` [PATCH 11/11] drivers/uwb: Rename dev_info to wdi Joe Perches
2010-04-05 21:44 ` Joe Perches
@ 2010-04-05 22:24 ` Joe Perches
1 sibling, 0 replies; 28+ messages in thread
From: Joe Perches @ 2010-04-05 22:24 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Vrabel, netdev, linux-kernel
Neglected to check-in the include file changed
There is a macro called dev_info that prints struct device specific
information. Having variables with the same name can be confusing and
prevents conversion of the macro to a function.
Rename the existing dev_info variables to something else in preparation
to converting the dev_info macro to a function.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/uwb/i1480/i1480u-wlp/lc.c | 16 ++++++------
drivers/uwb/wlp/messages.c | 40 ++++++++++++++++----------------
drivers/uwb/wlp/sysfs.c | 46 ++++++++++++++++++------------------
drivers/uwb/wlp/wlp-lc.c | 12 +++++-----
include/linux/wlp.h | 2 +-
5 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/drivers/uwb/i1480/i1480u-wlp/lc.c b/drivers/uwb/i1480/i1480u-wlp/lc.c
index f272dfe..bd52675 100644
--- a/drivers/uwb/i1480/i1480u-wlp/lc.c
+++ b/drivers/uwb/i1480/i1480u-wlp/lc.c
@@ -92,28 +92,28 @@ void i1480u_init(struct i1480u *i1480u)
* information elements have intuitive mappings, other not.
*/
static
-void i1480u_fill_device_info(struct wlp *wlp, struct wlp_device_info *dev_info)
+void i1480u_fill_device_info(struct wlp *wlp, struct wlp_device_info *wdi)
{
struct i1480u *i1480u = container_of(wlp, struct i1480u, wlp);
struct usb_device *usb_dev = i1480u->usb_dev;
/* Treat device name and model name the same */
if (usb_dev->descriptor.iProduct) {
usb_string(usb_dev, usb_dev->descriptor.iProduct,
- dev_info->name, sizeof(dev_info->name));
+ wdi->name, sizeof(wdi->name));
usb_string(usb_dev, usb_dev->descriptor.iProduct,
- dev_info->model_name, sizeof(dev_info->model_name));
+ wdi->model_name, sizeof(wdi->model_name));
}
if (usb_dev->descriptor.iManufacturer)
usb_string(usb_dev, usb_dev->descriptor.iManufacturer,
- dev_info->manufacturer,
- sizeof(dev_info->manufacturer));
- scnprintf(dev_info->model_nr, sizeof(dev_info->model_nr), "%04x",
+ wdi->manufacturer,
+ sizeof(wdi->manufacturer));
+ scnprintf(wdi->model_nr, sizeof(wdi->model_nr), "%04x",
__le16_to_cpu(usb_dev->descriptor.bcdDevice));
if (usb_dev->descriptor.iSerialNumber)
usb_string(usb_dev, usb_dev->descriptor.iSerialNumber,
- dev_info->serial, sizeof(dev_info->serial));
+ wdi->serial, sizeof(wdi->serial));
/* FIXME: where should we obtain category? */
- dev_info->prim_dev_type.category = cpu_to_le16(WLP_DEV_CAT_OTHER);
+ wdi->prim_dev_type.category = cpu_to_le16(WLP_DEV_CAT_OTHER);
/* FIXME: Complete OUI and OUIsubdiv attributes */
}
diff --git a/drivers/uwb/wlp/messages.c b/drivers/uwb/wlp/messages.c
index 7516486..4057942 100644
--- a/drivers/uwb/wlp/messages.c
+++ b/drivers/uwb/wlp/messages.c
@@ -712,7 +712,7 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss,
struct sk_buff *_skb;
void *d1_itr;
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0) {
dev_err(dev, "WLP: Unable to setup device "
@@ -720,7 +720,7 @@ static int wlp_build_assoc_d1(struct wlp *wlp, struct wlp_wss *wss,
goto error;
}
}
- info = wlp->dev_info;
+ info = wlp->wdi;
_skb = dev_alloc_skb(sizeof(*_d1)
+ sizeof(struct wlp_attr_uuid_e)
+ sizeof(struct wlp_attr_wss_sel_mthd)
@@ -794,7 +794,7 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss,
void *d2_itr;
size_t mem_needed;
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0) {
dev_err(dev, "WLP: Unable to setup device "
@@ -802,7 +802,7 @@ int wlp_build_assoc_d2(struct wlp *wlp, struct wlp_wss *wss,
goto error;
}
}
- info = wlp->dev_info;
+ info = wlp->wdi;
mem_needed = sizeof(*_d2)
+ sizeof(struct wlp_attr_uuid_e)
+ sizeof(struct wlp_attr_uuid_r)
@@ -970,7 +970,7 @@ error_parse:
*/
static
int wlp_get_variable_info(struct wlp *wlp, void *data,
- struct wlp_device_info *dev_info, ssize_t len)
+ struct wlp_device_info *wdi, ssize_t len)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
size_t used = 0;
@@ -993,7 +993,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_manufacturer(wlp, data + used,
- dev_info->manufacturer,
+ wdi->manufacturer,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain "
@@ -1011,7 +1011,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_model_name(wlp, data + used,
- dev_info->model_name,
+ wdi->model_name,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Model "
@@ -1028,7 +1028,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_model_nr(wlp, data + used,
- dev_info->model_nr,
+ wdi->model_nr,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Model "
@@ -1045,7 +1045,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_serial(wlp, data + used,
- dev_info->serial, len - used);
+ wdi->serial, len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Serial "
"number attribute from D1 message.\n");
@@ -1061,7 +1061,7 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
goto error_parse;
}
result = wlp_get_prim_dev_type(wlp, data + used,
- &dev_info->prim_dev_type,
+ &wdi->prim_dev_type,
len - used);
if (result < 0) {
dev_err(dev, "WLP: Unable to obtain Primary "
@@ -1069,10 +1069,10 @@ int wlp_get_variable_info(struct wlp *wlp, void *data,
"message.\n");
goto error_parse;
}
- dev_info->prim_dev_type.category =
- le16_to_cpu(dev_info->prim_dev_type.category);
- dev_info->prim_dev_type.subID =
- le16_to_cpu(dev_info->prim_dev_type.subID);
+ wdi->prim_dev_type.category =
+ le16_to_cpu(wdi->prim_dev_type.category);
+ wdi->prim_dev_type.subID =
+ le16_to_cpu(wdi->prim_dev_type.subID);
last = WLP_ATTR_PRI_DEV_TYPE;
used += result;
break;
@@ -1098,7 +1098,7 @@ static
int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
struct wlp_uuid *uuid_e,
enum wlp_wss_sel_mthd *sel_mthd,
- struct wlp_device_info *dev_info,
+ struct wlp_device_info *wdi,
enum wlp_assc_error *assc_err)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
@@ -1123,7 +1123,7 @@ int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
goto error_parse;
}
used += result;
- result = wlp_get_dev_name(wlp, ptr + used, dev_info->name,
+ result = wlp_get_dev_name(wlp, ptr + used, wdi->name,
len - used);
if (result < 0) {
dev_err(dev, "WLP: unable to obtain Device Name from D1 "
@@ -1131,7 +1131,7 @@ int wlp_parse_d1_frame(struct wlp *wlp, struct sk_buff *skb,
goto error_parse;
}
used += result;
- result = wlp_get_variable_info(wlp, ptr + used, dev_info, len - used);
+ result = wlp_get_variable_info(wlp, ptr + used, wdi, len - used);
if (result < 0) {
dev_err(dev, "WLP: unable to obtain Device Information from "
"D1 message.\n");
@@ -1171,15 +1171,15 @@ void wlp_handle_d1_frame(struct work_struct *ws)
struct device *dev = &wlp->rc->uwb_dev.dev;
struct wlp_uuid uuid_e;
enum wlp_wss_sel_mthd sel_mthd = 0;
- struct wlp_device_info dev_info;
+ struct wlp_device_info wdi;
enum wlp_assc_error assc_err;
struct sk_buff *resp = NULL;
/* Parse D1 frame */
mutex_lock(&wss->mutex);
mutex_lock(&wlp->mutex); /* to access wlp->uuid */
- memset(&dev_info, 0, sizeof(dev_info));
- result = wlp_parse_d1_frame(wlp, skb, &uuid_e, &sel_mthd, &dev_info,
+ memset(&wdi, 0, sizeof(wdi));
+ result = wlp_parse_d1_frame(wlp, skb, &uuid_e, &sel_mthd, &wdi,
&assc_err);
if (result < 0) {
dev_err(dev, "WLP: Unable to parse incoming D1 frame.\n");
diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c
index 6627c94..b24751c 100644
--- a/drivers/uwb/wlp/sysfs.c
+++ b/drivers/uwb/wlp/sysfs.c
@@ -333,12 +333,12 @@ ssize_t wlp_dev_##type##_show(struct wlp *wlp, char *buf) \
{ \
ssize_t result = 0; \
mutex_lock(&wlp->mutex); \
- if (wlp->dev_info == NULL) { \
+ if (wlp->wdi == NULL) { \
result = __wlp_setup_device_info(wlp); \
if (result < 0) \
goto out; \
} \
- result = scnprintf(buf, PAGE_SIZE, "%s\n", wlp->dev_info->type);\
+ result = scnprintf(buf, PAGE_SIZE, "%s\n", wlp->wdi->type); \
out: \
mutex_unlock(&wlp->mutex); \
return result; \
@@ -360,14 +360,14 @@ ssize_t wlp_dev_##type##_store(struct wlp *wlp, const char *buf, size_t size)\
ssize_t result; \
char format[10]; \
mutex_lock(&wlp->mutex); \
- if (wlp->dev_info == NULL) { \
+ if (wlp->wdi == NULL) { \
result = __wlp_alloc_device_info(wlp); \
if (result < 0) \
goto out; \
} \
- memset(wlp->dev_info->type, 0, sizeof(wlp->dev_info->type)); \
+ memset(wlp->wdi->type, 0, sizeof(wlp->wdi->type)); \
sprintf(format, "%%%uc", len); \
- result = sscanf(buf, format, wlp->dev_info->type); \
+ result = sscanf(buf, format, wlp->wdi->type); \
out: \
mutex_unlock(&wlp->mutex); \
return result < 0 ? result : size; \
@@ -409,13 +409,13 @@ ssize_t wlp_dev_prim_category_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%s\n",
- wlp_dev_category_str(wlp->dev_info->prim_dev_type.category));
+ wlp_dev_category_str(wlp->wdi->prim_dev_type.category));
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -428,7 +428,7 @@ ssize_t wlp_dev_prim_category_store(struct wlp *wlp, const char *buf,
ssize_t result;
u16 cat;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
@@ -436,7 +436,7 @@ ssize_t wlp_dev_prim_category_store(struct wlp *wlp, const char *buf,
result = sscanf(buf, "%hu", &cat);
if ((cat >= WLP_DEV_CAT_COMPUTER && cat <= WLP_DEV_CAT_TELEPHONE)
|| cat == WLP_DEV_CAT_OTHER)
- wlp->dev_info->prim_dev_type.category = cat;
+ wlp->wdi->prim_dev_type.category = cat;
else
result = -EINVAL;
out:
@@ -449,15 +449,15 @@ ssize_t wlp_dev_prim_OUI_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%02x:%02x:%02x\n",
- wlp->dev_info->prim_dev_type.OUI[0],
- wlp->dev_info->prim_dev_type.OUI[1],
- wlp->dev_info->prim_dev_type.OUI[2]);
+ wlp->wdi->prim_dev_type.OUI[0],
+ wlp->wdi->prim_dev_type.OUI[1],
+ wlp->wdi->prim_dev_type.OUI[2]);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -469,7 +469,7 @@ ssize_t wlp_dev_prim_OUI_store(struct wlp *wlp, const char *buf, size_t size)
ssize_t result;
u8 OUI[3];
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
@@ -480,7 +480,7 @@ ssize_t wlp_dev_prim_OUI_store(struct wlp *wlp, const char *buf, size_t size)
result = -EINVAL;
goto out;
} else
- memcpy(wlp->dev_info->prim_dev_type.OUI, OUI, sizeof(OUI));
+ memcpy(wlp->wdi->prim_dev_type.OUI, OUI, sizeof(OUI));
out:
mutex_unlock(&wlp->mutex);
return result < 0 ? result : size;
@@ -492,13 +492,13 @@ ssize_t wlp_dev_prim_OUI_sub_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%u\n",
- wlp->dev_info->prim_dev_type.OUIsubdiv);
+ wlp->wdi->prim_dev_type.OUIsubdiv);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -512,14 +512,14 @@ ssize_t wlp_dev_prim_OUI_sub_store(struct wlp *wlp, const char *buf,
unsigned sub;
u8 max_sub = ~0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
}
result = sscanf(buf, "%u", &sub);
if (sub <= max_sub)
- wlp->dev_info->prim_dev_type.OUIsubdiv = sub;
+ wlp->wdi->prim_dev_type.OUIsubdiv = sub;
else
result = -EINVAL;
out:
@@ -532,13 +532,13 @@ ssize_t wlp_dev_prim_subcat_show(struct wlp *wlp, char *buf)
{
ssize_t result = 0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_setup_device_info(wlp);
if (result < 0)
goto out;
}
result = scnprintf(buf, PAGE_SIZE, "%u\n",
- wlp->dev_info->prim_dev_type.subID);
+ wlp->wdi->prim_dev_type.subID);
out:
mutex_unlock(&wlp->mutex);
return result;
@@ -552,14 +552,14 @@ ssize_t wlp_dev_prim_subcat_store(struct wlp *wlp, const char *buf,
unsigned sub;
__le16 max_sub = ~0;
mutex_lock(&wlp->mutex);
- if (wlp->dev_info == NULL) {
+ if (wlp->wdi == NULL) {
result = __wlp_alloc_device_info(wlp);
if (result < 0)
goto out;
}
result = sscanf(buf, "%u", &sub);
if (sub <= max_sub)
- wlp->dev_info->prim_dev_type.subID = sub;
+ wlp->wdi->prim_dev_type.subID = sub;
else
result = -EINVAL;
out:
diff --git a/drivers/uwb/wlp/wlp-lc.c b/drivers/uwb/wlp/wlp-lc.c
index 13db739..530613e 100644
--- a/drivers/uwb/wlp/wlp-lc.c
+++ b/drivers/uwb/wlp/wlp-lc.c
@@ -39,9 +39,9 @@ void wlp_neighbor_init(struct wlp_neighbor_e *neighbor)
int __wlp_alloc_device_info(struct wlp *wlp)
{
struct device *dev = &wlp->rc->uwb_dev.dev;
- BUG_ON(wlp->dev_info != NULL);
- wlp->dev_info = kzalloc(sizeof(struct wlp_device_info), GFP_KERNEL);
- if (wlp->dev_info == NULL) {
+ BUG_ON(wlp->wdi != NULL);
+ wlp->wdi = kzalloc(sizeof(struct wlp_device_info), GFP_KERNEL);
+ if (wlp->wdi == NULL) {
dev_err(dev, "WLP: Unable to allocate memory for "
"device information.\n");
return -ENOMEM;
@@ -58,7 +58,7 @@ int __wlp_alloc_device_info(struct wlp *wlp)
static
void __wlp_fill_device_info(struct wlp *wlp)
{
- wlp->fill_device_info(wlp, wlp->dev_info);
+ wlp->fill_device_info(wlp, wlp->wdi);
}
/**
@@ -538,8 +538,8 @@ void wlp_remove(struct wlp *wlp)
uwb_notifs_deregister(wlp->rc, &wlp->uwb_notifs_handler);
wlp_eda_release(&wlp->eda);
mutex_lock(&wlp->mutex);
- if (wlp->dev_info != NULL)
- kfree(wlp->dev_info);
+ if (wlp->wdi != NULL)
+ kfree(wlp->wdi);
mutex_unlock(&wlp->mutex);
wlp->rc = NULL;
}
diff --git a/include/linux/wlp.h b/include/linux/wlp.h
index ac95ce6..e8e3ff2 100644
--- a/include/linux/wlp.h
+++ b/include/linux/wlp.h
@@ -655,7 +655,7 @@ struct wlp {
struct mutex nbmutex; /* Neighbor mutex protects neighbors list */
struct list_head neighbors; /* Elements are wlp_neighbor_e */
struct uwb_notifs_handler uwb_notifs_handler;
- struct wlp_device_info *dev_info;
+ struct wlp_device_info *wdi;
void (*fill_device_info)(struct wlp *wlp, struct wlp_device_info *info);
int (*xmit_frame)(struct wlp *, struct sk_buff *,
struct uwb_dev_addr *);
^ permalink raw reply related [flat|nested] 28+ messages in thread