hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/rtc/rtc-hym8563.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Haoyu HYM8563 RTC driver
34 *
....@@ -6,15 +7,6 @@
67 *
78 * based on rtc-HYM8563
89 * Copyright (C) 2010 ROCKCHIP, Inc.
9
- *
10
- * This software is licensed under the terms of the GNU General Public
11
- * License version 2, as published by the Free Software Foundation, and
12
- * may be copied, distributed, and modified under those terms.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
1810 */
1911
2012 #include <linux/module.h>
....@@ -102,6 +94,8 @@
10294 int ret;
10395
10496 ret = i2c_smbus_read_i2c_block_data(client, HYM8563_SEC, 7, buf);
97
+ if (ret < 0)
98
+ return ret;
10599
106100 tm->tm_sec = bcd2bin(buf[0] & HYM8563_SEC_MASK);
107101 tm->tm_min = bcd2bin(buf[1] & HYM8563_MIN_MASK);
....@@ -417,17 +411,11 @@
417411 struct i2c_client *client = hym8563->client;
418412 struct device_node *node = client->dev.of_node;
419413 struct clk *clk;
420
- struct clk_init_data init = {};
421
- int ret;
422
-
423
- ret = i2c_smbus_write_byte_data(client, HYM8563_CLKOUT,
424
- 0);
425
- if (ret < 0)
426
- return ERR_PTR(ret);
414
+ struct clk_init_data init;
427415
428416 init.name = "hym8563-clkout";
429417 init.ops = &hym8563_clkout_ops;
430
- init.flags = 0;
418
+ init.flags = CLK_IS_CRITICAL;
431419 init.parent_names = NULL;
432420 init.num_parents = 0;
433421 hym8563->clkout_hw.init = &init;