| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * HID Sensor Time Driver |
|---|
| 3 | 4 | * Copyright (c) 2012, Alexander Holler. |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 7 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 12 | | - * more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 15 | | - * this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 16 | | - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
|---|
| 17 | | - * |
|---|
| 18 | 5 | */ |
|---|
| 19 | 6 | #include <linux/device.h> |
|---|
| 20 | 7 | #include <linux/platform_device.h> |
|---|
| .. | .. |
|---|
| 205 | 192 | static int hid_rtc_read_time(struct device *dev, struct rtc_time *tm) |
|---|
| 206 | 193 | { |
|---|
| 207 | 194 | unsigned long flags; |
|---|
| 208 | | - struct hid_time_state *time_state = |
|---|
| 209 | | - platform_get_drvdata(to_platform_device(dev)); |
|---|
| 195 | + struct hid_time_state *time_state = dev_get_drvdata(dev); |
|---|
| 210 | 196 | int ret; |
|---|
| 211 | 197 | |
|---|
| 212 | 198 | reinit_completion(&time_state->comp_last_time); |
|---|