Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more s/temp/temperature/ fixes

  • Loading branch information...
commit 54af10ba14eaf8e7d8b25989d5b433940fbc96cf 1 parent 5ef05cc
@gregkh authored
Showing with 24 additions and 24 deletions.
  1. +8 −8 src/step-4/gotemp.c
  2. +7 −7 src/step-5/gotemp.c
  3. +9 −9 src/step-6/gotemp.c
View
16 src/step-4/gotemp.c
@@ -15,18 +15,18 @@ MODULE_DEVICE_TABLE(usb, id_table);
struct gotemp {
struct usb_device *udev;
- int temp;
+ int temperature;
};
-static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
- char *buf)
+static ssize_t show_temperature(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_interface *intf = to_usb_interface(dev);
struct gotemp *gdev = usb_get_intfdata(intf);
- return sprintf(buf, "%d\n", gdev->temp);
+ return sprintf(buf, "%d\n", gdev->temperature);
}
-static DEVICE_ATTR(temp, S_IRUGO, show_temp, NULL);
+static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
static int gotemp_probe(struct usb_interface *interface,
const struct usb_device_id *id)
@@ -45,8 +45,8 @@ static int gotemp_probe(struct usb_interface *interface,
usb_set_intfdata(interface, gdev);
- gdev->temp = 42;
- retval = device_create_file(&interface->dev, &dev_attr_temp);
+ gdev->temperature = 42;
+ retval = device_create_file(&interface->dev, &dev_attr_temperature);
if (retval)
goto error;
@@ -66,7 +66,7 @@ static void gotemp_disconnect(struct usb_interface *interface)
gdev = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
- device_remove_file(&interface->dev, &dev_attr_temp);
+ device_remove_file(&interface->dev, &dev_attr_temperature);
usb_put_dev(gdev->udev);
View
14 src/step-5/gotemp.c
@@ -15,7 +15,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
struct gotemp {
struct usb_device *udev;
- int temp;
+ int temperature;
};
#define CMD_ID_START_MEASUREMENTS 0x18
@@ -60,15 +60,15 @@ static void init_dev(struct gotemp *gdev)
send_cmd(gdev, CMD_ID_START_MEASUREMENTS);
}
-static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
- char *buf)
+static ssize_t show_temperature(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_interface *intf = to_usb_interface(dev);
struct gotemp *gdev = usb_get_intfdata(intf);
- return sprintf(buf, "%d\n", gdev->temp);
+ return sprintf(buf, "%d\n", gdev->temperature);
}
-static DEVICE_ATTR(temp, S_IRUGO, show_temp, NULL);
+static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
static int gotemp_probe(struct usb_interface *interface,
const struct usb_device_id *id)
@@ -89,7 +89,7 @@ static int gotemp_probe(struct usb_interface *interface,
init_dev(gdev);
- retval = device_create_file(&interface->dev, &dev_attr_temp);
+ retval = device_create_file(&interface->dev, &dev_attr_temperature);
if (retval)
goto error;
@@ -109,7 +109,7 @@ static void gotemp_disconnect(struct usb_interface *interface)
gdev = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
- device_remove_file(&interface->dev, &dev_attr_temp);
+ device_remove_file(&interface->dev, &dev_attr_temperature);
usb_put_dev(gdev->udev);
View
18 src/step-6/gotemp.c
@@ -15,7 +15,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
struct gotemp {
struct usb_device *udev;
- int temp;
+ int temperature;
unsigned char *int_in_buffer; /* the buffer to receive data */
struct urb *int_in_urb;
};
@@ -78,15 +78,15 @@ static void init_dev(struct gotemp *gdev)
send_cmd(gdev, CMD_ID_START_MEASUREMENTS);
}
-static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
- char *buf)
+static ssize_t show_temperature(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_interface *intf = to_usb_interface(dev);
struct gotemp *gdev = usb_get_intfdata(intf);
- return sprintf(buf, "%d\n", gdev->temp);
+ return sprintf(buf, "%d\n", gdev->temperature);
}
-static DEVICE_ATTR(temp, S_IRUGO, show_temp, NULL);
+static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
static void read_int_callback(struct urb *urb)
{
@@ -112,10 +112,10 @@ static void read_int_callback(struct urb *urb)
goto exit;
}
- dev_info(&urb->dev->dev, "counter %d, temp=%d\n",
+ dev_info(&urb->dev->dev, "counter %d, temperature=%d\n",
measurement->rolling_counter,
measurement->measurement0);
- gdev->temp = le16_to_cpu(measurement->measurement0);
+ gdev->temperature = le16_to_cpu(measurement->measurement0);
exit:
retval = usb_submit_urb(urb, GFP_ATOMIC);
@@ -167,7 +167,7 @@ static int gotemp_probe(struct usb_interface *interface,
init_dev(gdev);
- retval = device_create_file(&interface->dev, &dev_attr_temp);
+ retval = device_create_file(&interface->dev, &dev_attr_temperature);
if (retval)
goto error;
@@ -188,7 +188,7 @@ static void gotemp_disconnect(struct usb_interface *interface)
gdev = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
- device_remove_file(&interface->dev, &dev_attr_temp);
+ device_remove_file(&interface->dev, &dev_attr_temperature);
usb_put_dev(gdev->udev);
Please sign in to comment.
Something went wrong with that request. Please try again.