| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Haoyu HYM8563 RTC driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * based on rtc-HYM8563 |
|---|
| 8 | 9 | * 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. |
|---|
| 18 | 10 | */ |
|---|
| 19 | 11 | |
|---|
| 20 | 12 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 102 | 94 | int ret; |
|---|
| 103 | 95 | |
|---|
| 104 | 96 | ret = i2c_smbus_read_i2c_block_data(client, HYM8563_SEC, 7, buf); |
|---|
| 97 | + if (ret < 0) |
|---|
| 98 | + return ret; |
|---|
| 105 | 99 | |
|---|
| 106 | 100 | tm->tm_sec = bcd2bin(buf[0] & HYM8563_SEC_MASK); |
|---|
| 107 | 101 | tm->tm_min = bcd2bin(buf[1] & HYM8563_MIN_MASK); |
|---|
| .. | .. |
|---|
| 417 | 411 | struct i2c_client *client = hym8563->client; |
|---|
| 418 | 412 | struct device_node *node = client->dev.of_node; |
|---|
| 419 | 413 | 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; |
|---|
| 427 | 415 | |
|---|
| 428 | 416 | init.name = "hym8563-clkout"; |
|---|
| 429 | 417 | init.ops = &hym8563_clkout_ops; |
|---|
| 430 | | - init.flags = 0; |
|---|
| 418 | + init.flags = CLK_IS_CRITICAL; |
|---|
| 431 | 419 | init.parent_names = NULL; |
|---|
| 432 | 420 | init.num_parents = 0; |
|---|
| 433 | 421 | hym8563->clkout_hw.init = &init; |
|---|