Commit 10804f0fb89561d63b2131be17cfaf8d1a30468c

Authored by Stephen Rothwell
Committed by Paul Mackerras
1 parent 98894dffaf

[POWERPC] therm_adt746x: Eliminate some build warnings

We don't care if the device_create_file calls fail, the driver will work
just as well without them, so just issue a runtime warning.

drivers/macintosh/therm_adt746x.c: In function 'thermostat_init':
drivers/macintosh/therm_adt746x.c:615: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:616: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:617: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:618: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:619: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:620: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:621: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:622: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:623: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result
drivers/macintosh/therm_adt746x.c:625: warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 1 changed file with 14 additions and 10 deletions Side-by-side Diff

drivers/macintosh/therm_adt746x.c
... ... @@ -553,6 +553,7 @@
553 553 struct device_node* np;
554 554 const u32 *prop;
555 555 int i = 0, offset = 0;
  556 + int err;
556 557  
557 558 np = of_find_node_by_name(NULL, "fan");
558 559 if (!np)
559 560  
... ... @@ -612,17 +613,20 @@
612 613 return -ENODEV;
613 614 }
614 615  
615   - device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
616   - device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
617   - device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
618   - device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
619   - device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
620   - device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
621   - device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
622   - device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
623   - device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
  616 + err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
  617 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
  618 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
  619 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
  620 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
  621 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
  622 + err |= device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
  623 + err |= device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
  624 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
624 625 if(therm_type == ADT7460)
625   - device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
  626 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
  627 + if (err)
  628 + printk(KERN_WARNING
  629 + "Failed to create tempertaure attribute file(s).\n");
626 630  
627 631 #ifndef CONFIG_I2C_POWERMAC
628 632 request_module("i2c-powermac");