Commit 4057a66e authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: ds1307: fix alignments and blank lines

Alignment should always match open parenthesis.
Also remove two unnecessary blank lines
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent eb4fd190
...@@ -51,7 +51,6 @@ enum ds_type { ...@@ -51,7 +51,6 @@ enum ds_type {
/* rs5c372 too? different address... */ /* rs5c372 too? different address... */
}; };
/* RTC registers don't differ much, except for the century flag */ /* RTC registers don't differ much, except for the century flag */
#define DS1307_REG_SECS 0x00 /* 00-59 */ #define DS1307_REG_SECS 0x00 /* 00-59 */
# define DS1307_BIT_CH 0x80 # define DS1307_BIT_CH 0x80
...@@ -114,7 +113,6 @@ enum ds_type { ...@@ -114,7 +113,6 @@ enum ds_type {
# define RX8025_BIT_VDET 0x40 # define RX8025_BIT_VDET 0x40
# define RX8025_BIT_XST 0x20 # define RX8025_BIT_XST 0x20
struct ds1307 { struct ds1307 {
struct nvmem_config nvmem_cfg; struct nvmem_config nvmem_cfg;
enum ds_type type; enum ds_type type;
...@@ -1042,7 +1040,7 @@ static int ds3231_hwmon_read_temp(struct device *dev, s32 *mC) ...@@ -1042,7 +1040,7 @@ static int ds3231_hwmon_read_temp(struct device *dev, s32 *mC)
} }
static ssize_t ds3231_hwmon_show_temp(struct device *dev, static ssize_t ds3231_hwmon_show_temp(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
int ret; int ret;
s32 temp; s32 temp;
...@@ -1054,7 +1052,7 @@ static ssize_t ds3231_hwmon_show_temp(struct device *dev, ...@@ -1054,7 +1052,7 @@ static ssize_t ds3231_hwmon_show_temp(struct device *dev,
return sprintf(buf, "%d\n", temp); return sprintf(buf, "%d\n", temp);
} }
static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ds3231_hwmon_show_temp, static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, ds3231_hwmon_show_temp,
NULL, 0); NULL, 0);
static struct attribute *ds3231_hwmon_attrs[] = { static struct attribute *ds3231_hwmon_attrs[] = {
&sensor_dev_attr_temp1_input.dev_attr.attr, &sensor_dev_attr_temp1_input.dev_attr.attr,
...@@ -1070,7 +1068,8 @@ static void ds1307_hwmon_register(struct ds1307 *ds1307) ...@@ -1070,7 +1068,8 @@ static void ds1307_hwmon_register(struct ds1307 *ds1307)
return; return;
dev = devm_hwmon_device_register_with_groups(ds1307->dev, ds1307->name, dev = devm_hwmon_device_register_with_groups(ds1307->dev, ds1307->name,
ds1307, ds3231_hwmon_groups); ds1307,
ds3231_hwmon_groups);
if (IS_ERR(dev)) { if (IS_ERR(dev)) {
dev_warn(ds1307->dev, "unable to register hwmon device %ld\n", dev_warn(ds1307->dev, "unable to register hwmon device %ld\n",
PTR_ERR(dev)); PTR_ERR(dev));
...@@ -1142,7 +1141,7 @@ static unsigned long ds3231_clk_sqw_recalc_rate(struct clk_hw *hw, ...@@ -1142,7 +1141,7 @@ static unsigned long ds3231_clk_sqw_recalc_rate(struct clk_hw *hw,
} }
static long ds3231_clk_sqw_round_rate(struct clk_hw *hw, unsigned long rate, static long ds3231_clk_sqw_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate) unsigned long *prate)
{ {
int i; int i;
...@@ -1155,7 +1154,7 @@ static long ds3231_clk_sqw_round_rate(struct clk_hw *hw, unsigned long rate, ...@@ -1155,7 +1154,7 @@ static long ds3231_clk_sqw_round_rate(struct clk_hw *hw, unsigned long rate,
} }
static int ds3231_clk_sqw_set_rate(struct clk_hw *hw, unsigned long rate, static int ds3231_clk_sqw_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) unsigned long parent_rate)
{ {
struct ds1307 *ds1307 = clk_sqw_to_ds1307(hw); struct ds1307 *ds1307 = clk_sqw_to_ds1307(hw);
int control = 0; int control = 0;
...@@ -1215,7 +1214,7 @@ static const struct clk_ops ds3231_clk_sqw_ops = { ...@@ -1215,7 +1214,7 @@ static const struct clk_ops ds3231_clk_sqw_ops = {
}; };
static unsigned long ds3231_clk_32khz_recalc_rate(struct clk_hw *hw, static unsigned long ds3231_clk_32khz_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) unsigned long parent_rate)
{ {
return 32768; return 32768;
} }
...@@ -1306,7 +1305,7 @@ static int ds3231_clks_register(struct ds1307 *ds1307) ...@@ -1306,7 +1305,7 @@ static int ds3231_clks_register(struct ds1307 *ds1307)
/* optional override of the clockname */ /* optional override of the clockname */
of_property_read_string_index(node, "clock-output-names", i, of_property_read_string_index(node, "clock-output-names", i,
&init.name); &init.name);
ds1307->clks[i].init = &init; ds1307->clks[i].init = &init;
onecell->clks[i] = devm_clk_register(ds1307->dev, onecell->clks[i] = devm_clk_register(ds1307->dev,
...@@ -1570,8 +1569,8 @@ static int ds1307_probe(struct i2c_client *client, ...@@ -1570,8 +1569,8 @@ static int ds1307_probe(struct i2c_client *client,
/* oscillator fault? clear flag, and warn */ /* oscillator fault? clear flag, and warn */
if (regs[DS1307_REG_CONTROL] & DS1338_BIT_OSF) { if (regs[DS1307_REG_CONTROL] & DS1338_BIT_OSF) {
regmap_write(ds1307->regmap, DS1307_REG_CONTROL, regmap_write(ds1307->regmap, DS1307_REG_CONTROL,
regs[DS1307_REG_CONTROL] & regs[DS1307_REG_CONTROL] &
~DS1338_BIT_OSF); ~DS1338_BIT_OSF);
dev_warn(ds1307->dev, "SET TIME!\n"); dev_warn(ds1307->dev, "SET TIME!\n");
goto read_rtc; goto read_rtc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment