.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
1 | 2 | /* |
---|
2 | 3 | * SPI driver for Micrel/Kendin KS8995M and KSZ8864RMN ethernet switches |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * This file was based on: drivers/spi/at25.c |
---|
7 | 8 | * Copyright (C) 2006 David Brownell |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify it |
---|
10 | | - * under the terms of the GNU General Public License version 2 as published |
---|
11 | | - * by the Free Software Foundation. |
---|
12 | 9 | */ |
---|
13 | 10 | |
---|
14 | 11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
---|
.. | .. |
---|
303 | 300 | struct device *dev; |
---|
304 | 301 | struct ks8995_switch *ks8995; |
---|
305 | 302 | |
---|
306 | | - dev = container_of(kobj, struct device, kobj); |
---|
| 303 | + dev = kobj_to_dev(kobj); |
---|
307 | 304 | ks8995 = dev_get_drvdata(dev); |
---|
308 | 305 | |
---|
309 | 306 | return ks8995_read(ks8995, buf, off, count); |
---|
.. | .. |
---|
315 | 312 | struct device *dev; |
---|
316 | 313 | struct ks8995_switch *ks8995; |
---|
317 | 314 | |
---|
318 | | - dev = container_of(kobj, struct device, kobj); |
---|
| 315 | + dev = kobj_to_dev(kobj); |
---|
319 | 316 | ks8995 = dev_get_drvdata(dev); |
---|
320 | 317 | |
---|
321 | 318 | return ks8995_write(ks8995, buf, off, count); |
---|