diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-09-04 16:46:06 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-09-05 03:55:05 -0400 |
commit | 4057a66e5333bf487c35a37119e3012a4b318e22 (patch) | |
tree | 59c24d78ca33e358f358181d9481ac5e47925c0c | |
parent | eb4fd19005b73be8d7f51b564aa87a59a7fb4328 (diff) |
rtc: ds1307: fix alignments and blank lines
Alignment should always match open parenthesis.
Also remove two unnecessary blank lines
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r-- | drivers/rtc/rtc-ds1307.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 5b2fe3579e45..bac0f9ec9351 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c | |||
@@ -51,7 +51,6 @@ enum ds_type { | |||
51 | /* rs5c372 too? different address... */ | 51 | /* rs5c372 too? different address... */ |
52 | }; | 52 | }; |
53 | 53 | ||
54 | |||
55 | /* RTC registers don't differ much, except for the century flag */ | 54 | /* RTC registers don't differ much, except for the century flag */ |
56 | #define DS1307_REG_SECS 0x00 /* 00-59 */ | 55 | #define DS1307_REG_SECS 0x00 /* 00-59 */ |
57 | # define DS1307_BIT_CH 0x80 | 56 | # define DS1307_BIT_CH 0x80 |
@@ -114,7 +113,6 @@ enum ds_type { | |||
114 | # define RX8025_BIT_VDET 0x40 | 113 | # define RX8025_BIT_VDET 0x40 |
115 | # define RX8025_BIT_XST 0x20 | 114 | # define RX8025_BIT_XST 0x20 |
116 | 115 | ||
117 | |||
118 | struct ds1307 { | 116 | struct ds1307 { |
119 | struct nvmem_config nvmem_cfg; | 117 | struct nvmem_config nvmem_cfg; |
120 | enum ds_type type; | 118 | enum ds_type type; |
@@ -1042,7 +1040,7 @@ static int ds3231_hwmon_read_temp(struct device *dev, s32 *mC) | |||
1042 | } | 1040 | } |
1043 | 1041 | ||
1044 | static ssize_t ds3231_hwmon_show_temp(struct device *dev, | 1042 | static ssize_t ds3231_hwmon_show_temp(struct device *dev, |
1045 | struct device_attribute *attr, char *buf) | 1043 | struct device_attribute *attr, char *buf) |
1046 | { | 1044 | { |
1047 | int ret; | 1045 | int ret; |
1048 | s32 temp; | 1046 | s32 temp; |
@@ -1054,7 +1052,7 @@ static ssize_t ds3231_hwmon_show_temp(struct device *dev, | |||
1054 | return sprintf(buf, "%d\n", temp); | 1052 | return sprintf(buf, "%d\n", temp); |
1055 | } | 1053 | } |
1056 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ds3231_hwmon_show_temp, | 1054 | static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ds3231_hwmon_show_temp, |
1057 | NULL, 0); | 1055 | NULL, 0); |
1058 | 1056 | ||
1059 | static struct attribute *ds3231_hwmon_attrs[] = { | 1057 | static struct attribute *ds3231_hwmon_attrs[] = { |
1060 | &sensor_dev_attr_temp1_input.dev_attr.attr, | 1058 | &sensor_dev_attr_temp1_input.dev_attr.attr, |
@@ -1070,7 +1068,8 @@ static void ds1307_hwmon_register(struct ds1307 *ds1307) | |||
1070 | return; | 1068 | return; |
1071 | 1069 | ||
1072 | dev = devm_hwmon_device_register_with_groups(ds1307->dev, ds1307->name, | 1070 | dev = devm_hwmon_device_register_with_groups(ds1307->dev, ds1307->name, |
1073 | ds1307, ds3231_hwmon_groups); | 1071 | ds1307, |
1072 | ds3231_hwmon_groups); | ||
1074 | if (IS_ERR(dev)) { | 1073 | if (IS_ERR(dev)) { |
1075 | dev_warn(ds1307->dev, "unable to register hwmon device %ld\n", | 1074 | dev_warn(ds1307->dev, "unable to register hwmon device %ld\n", |
1076 | PTR_ERR(dev)); | 1075 | PTR_ERR(dev)); |
@@ -1142,7 +1141,7 @@ static unsigned long ds3231_clk_sqw_recalc_rate(struct clk_hw *hw, | |||
1142 | } | 1141 | } |
1143 | 1142 | ||
1144 | static long ds3231_clk_sqw_round_rate(struct clk_hw *hw, unsigned long rate, | 1143 | static long ds3231_clk_sqw_round_rate(struct clk_hw *hw, unsigned long rate, |
1145 | unsigned long *prate) | 1144 | unsigned long *prate) |
1146 | { | 1145 | { |
1147 | int i; | 1146 | int i; |
1148 | 1147 | ||
@@ -1155,7 +1154,7 @@ static long ds3231_clk_sqw_round_rate(struct clk_hw *hw, unsigned long rate, | |||
1155 | } | 1154 | } |
1156 | 1155 | ||
1157 | static int ds3231_clk_sqw_set_rate(struct clk_hw *hw, unsigned long rate, | 1156 | static int ds3231_clk_sqw_set_rate(struct clk_hw *hw, unsigned long rate, |
1158 | unsigned long parent_rate) | 1157 | unsigned long parent_rate) |
1159 | { | 1158 | { |
1160 | struct ds1307 *ds1307 = clk_sqw_to_ds1307(hw); | 1159 | struct ds1307 *ds1307 = clk_sqw_to_ds1307(hw); |
1161 | int control = 0; | 1160 | int control = 0; |
@@ -1215,7 +1214,7 @@ static const struct clk_ops ds3231_clk_sqw_ops = { | |||
1215 | }; | 1214 | }; |
1216 | 1215 | ||
1217 | static unsigned long ds3231_clk_32khz_recalc_rate(struct clk_hw *hw, | 1216 | static unsigned long ds3231_clk_32khz_recalc_rate(struct clk_hw *hw, |
1218 | unsigned long parent_rate) | 1217 | unsigned long parent_rate) |
1219 | { | 1218 | { |
1220 | return 32768; | 1219 | return 32768; |
1221 | } | 1220 | } |
@@ -1306,7 +1305,7 @@ static int ds3231_clks_register(struct ds1307 *ds1307) | |||
1306 | 1305 | ||
1307 | /* optional override of the clockname */ | 1306 | /* optional override of the clockname */ |
1308 | of_property_read_string_index(node, "clock-output-names", i, | 1307 | of_property_read_string_index(node, "clock-output-names", i, |
1309 | &init.name); | 1308 | &init.name); |
1310 | ds1307->clks[i].init = &init; | 1309 | ds1307->clks[i].init = &init; |
1311 | 1310 | ||
1312 | onecell->clks[i] = devm_clk_register(ds1307->dev, | 1311 | onecell->clks[i] = devm_clk_register(ds1307->dev, |
@@ -1570,8 +1569,8 @@ read_rtc: | |||
1570 | /* oscillator fault? clear flag, and warn */ | 1569 | /* oscillator fault? clear flag, and warn */ |
1571 | if (regs[DS1307_REG_CONTROL] & DS1338_BIT_OSF) { | 1570 | if (regs[DS1307_REG_CONTROL] & DS1338_BIT_OSF) { |
1572 | regmap_write(ds1307->regmap, DS1307_REG_CONTROL, | 1571 | regmap_write(ds1307->regmap, DS1307_REG_CONTROL, |
1573 | regs[DS1307_REG_CONTROL] & | 1572 | regs[DS1307_REG_CONTROL] & |
1574 | ~DS1338_BIT_OSF); | 1573 | ~DS1338_BIT_OSF); |
1575 | dev_warn(ds1307->dev, "SET TIME!\n"); | 1574 | dev_warn(ds1307->dev, "SET TIME!\n"); |
1576 | goto read_rtc; | 1575 | goto read_rtc; |
1577 | } | 1576 | } |