Commit 019cddc8 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull second i2c update from Wolfram Sang:
 "As promised, here is my 2nd pull request for I2C, containing:

   - removal of the attach_adapter callback, converting its last user

   - removal of any __deprecated usage within I2C

   - one email address update

   - some SPDX conversion"

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: don't use any __deprecated handling anymore
  i2c: use SPDX identifier for Renesas drivers
  i2c: ocores: update my email address
  i2c: remove deprecated attach_adapter callback
  macintosh: therm_windtunnel: drop using attach_adapter
parents d002924f 00efcdce
...@@ -4,7 +4,7 @@ Supported adapters: ...@@ -4,7 +4,7 @@ Supported adapters:
* OpenCores.org I2C controller by Richard Herveille (see datasheet link) * OpenCores.org I2C controller by Richard Herveille (see datasheet link)
https://opencores.org/project/i2c/overview https://opencores.org/project/i2c/overview
Author: Peter Korsgaard <jacmet@sunsite.dk> Author: Peter Korsgaard <peter@korsgaard.com>
Description Description
----------- -----------
......
...@@ -10787,7 +10787,7 @@ F: arch/*/boot/dts/ ...@@ -10787,7 +10787,7 @@ F: arch/*/boot/dts/
F: include/dt-bindings/ F: include/dt-bindings/
OPENCORES I2C BUS DRIVER OPENCORES I2C BUS DRIVER
M: Peter Korsgaard <jacmet@sunsite.dk> M: Peter Korsgaard <peter@korsgaard.com>
L: linux-i2c@vger.kernel.org L: linux-i2c@vger.kernel.org
S: Maintained S: Maintained
F: Documentation/i2c/busses/i2c-ocores F: Documentation/i2c/busses/i2c-ocores
......
...@@ -18,4 +18,3 @@ obj-$(CONFIG_I2C_STUB) += i2c-stub.o ...@@ -18,4 +18,3 @@ obj-$(CONFIG_I2C_STUB) += i2c-stub.o
obj-$(CONFIG_I2C_SLAVE_EEPROM) += i2c-slave-eeprom.o obj-$(CONFIG_I2C_SLAVE_EEPROM) += i2c-slave-eeprom.o
ccflags-$(CONFIG_I2C_DEBUG_CORE) := -DDEBUG ccflags-$(CONFIG_I2C_DEBUG_CORE) := -DDEBUG
CFLAGS_i2c-core-base.o := -Wno-deprecated-declarations
// SPDX-License-Identifier: GPL-2.0
/* /*
* I2C driver for the Renesas EMEV2 SoC * I2C driver for the Renesas EMEV2 SoC
* *
* Copyright (C) 2015 Wolfram Sang <wsa@sang-engineering.com> * Copyright (C) 2015 Wolfram Sang <wsa@sang-engineering.com>
* Copyright 2013 Codethink Ltd. * Copyright 2013 Codethink Ltd.
* Copyright 2010-2015 Renesas Electronics Corporation * Copyright 2010-2015 Renesas Electronics Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*/ */
#include <linux/clk.h> #include <linux/clk.h>
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Renesas Solutions Highlander FPGA I2C/SMBus support. * Renesas Solutions Highlander FPGA I2C/SMBus support.
* *
...@@ -6,10 +7,6 @@ ...@@ -6,10 +7,6 @@
* Copyright (C) 2008 Paul Mundt * Copyright (C) 2008 Paul Mundt
* Copyright (C) 2008 Renesas Solutions Corp. * Copyright (C) 2008 Renesas Solutions Corp.
* Copyright (C) 2008 Atom Create Engineering Co., Ltd. * Copyright (C) 2008 Atom Create Engineering Co., Ltd.
*
* This file is subject to the terms and conditions of the GNU General
* Public License version 2. See the file "COPYING" in the main directory
* of this archive for more details.
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* i2c-ocores.c: I2C bus driver for OpenCores I2C controller * i2c-ocores.c: I2C bus driver for OpenCores I2C controller
* (https://opencores.org/project/i2c/overview) * (https://opencores.org/project/i2c/overview)
* *
* Peter Korsgaard <jacmet@sunsite.dk> * Peter Korsgaard <peter@korsgaard.com>
* *
* Support for the GRLIB port of the controller by * Support for the GRLIB port of the controller by
* Andreas Larsson <andreas@gaisler.com> * Andreas Larsson <andreas@gaisler.com>
...@@ -576,7 +576,7 @@ static struct platform_driver ocores_i2c_driver = { ...@@ -576,7 +576,7 @@ static struct platform_driver ocores_i2c_driver = {
module_platform_driver(ocores_i2c_driver); module_platform_driver(ocores_i2c_driver);
MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); MODULE_AUTHOR("Peter Korsgaard <peter@korsgaard.com>");
MODULE_DESCRIPTION("OpenCores I2C bus driver"); MODULE_DESCRIPTION("OpenCores I2C bus driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:ocores-i2c"); MODULE_ALIAS("platform:ocores-i2c");
// SPDX-License-Identifier: GPL-2.0
/* /*
* Driver for the Renesas R-Car I2C unit * Driver for the Renesas R-Car I2C unit
* *
...@@ -9,15 +10,6 @@ ...@@ -9,15 +10,6 @@
* *
* This file is based on the drivers/i2c/busses/i2c-sh7760.c * This file is based on the drivers/i2c/busses/i2c-sh7760.c
* (c) 2005-2008 MSC Vertriebsges.m.b.H, Manuel Lauss <mlau@msc-ge.com> * (c) 2005-2008 MSC Vertriebsges.m.b.H, Manuel Lauss <mlau@msc-ge.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/ */
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/clk.h> #include <linux/clk.h>
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Renesas RIIC driver * Renesas RIIC driver
* *
* Copyright (C) 2013 Wolfram Sang <wsa@sang-engineering.com> * Copyright (C) 2013 Wolfram Sang <wsa@sang-engineering.com>
* Copyright (C) 2013 Renesas Solutions Corp. * Copyright (C) 2013 Renesas Solutions Corp.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/ */
/* /*
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* SuperH Mobile I2C Controller * SuperH Mobile I2C Controller
* *
...@@ -7,15 +8,6 @@ ...@@ -7,15 +8,6 @@
* *
* Portions of the code based on out-of-tree driver i2c-sh7343.c * Portions of the code based on out-of-tree driver i2c-sh7343.c
* Copyright (c) 2006 Carlos Munoz <carlos@kenati.com> * Copyright (c) 2006 Carlos Munoz <carlos@kenati.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/ */
#include <linux/clk.h> #include <linux/clk.h>
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
/* /*
* core_lock protects i2c_adapter_idr, and guarantees that device detection, * core_lock protects i2c_adapter_idr, and guarantees that device detection,
* deletion of detected devices, and attach_adapter calls are serialized * deletion of detected devices are serialized
*/ */
static DEFINE_MUTEX(core_lock); static DEFINE_MUTEX(core_lock);
static DEFINE_IDR(i2c_adapter_idr); static DEFINE_IDR(i2c_adapter_idr);
...@@ -1124,15 +1124,6 @@ static int i2c_do_add_adapter(struct i2c_driver *driver, ...@@ -1124,15 +1124,6 @@ static int i2c_do_add_adapter(struct i2c_driver *driver,
/* Detect supported devices on that bus, and instantiate them */ /* Detect supported devices on that bus, and instantiate them */
i2c_detect(adap, driver); i2c_detect(adap, driver);
/* Let legacy drivers scan this bus for matching devices */
if (driver->attach_adapter) {
dev_warn(&adap->dev, "%s: attach_adapter method is deprecated\n",
driver->driver.name);
dev_warn(&adap->dev,
"Please use another way to instantiate your i2c_client\n");
/* We ignore the return code; if it fails, too bad */
driver->attach_adapter(adap);
}
return 0; return 0;
} }
......
...@@ -432,7 +432,6 @@ static struct i2c_driver g4fan_driver = { ...@@ -432,7 +432,6 @@ static struct i2c_driver g4fan_driver = {
.driver = { .driver = {
.name = "therm_windtunnel", .name = "therm_windtunnel",
}, },
.attach_adapter = do_attach,
.probe = do_probe, .probe = do_probe,
.remove = do_remove, .remove = do_remove,
.id_table = therm_windtunnel_id, .id_table = therm_windtunnel_id,
...@@ -445,7 +444,29 @@ static struct i2c_driver g4fan_driver = { ...@@ -445,7 +444,29 @@ static struct i2c_driver g4fan_driver = {
static int therm_of_probe(struct platform_device *dev) static int therm_of_probe(struct platform_device *dev)
{ {
return i2c_add_driver( &g4fan_driver ); struct i2c_adapter *adap;
int ret, i = 0;
adap = i2c_get_adapter(0);
if (!adap)
return -EPROBE_DEFER;
ret = i2c_add_driver(&g4fan_driver);
if (ret) {
i2c_put_adapter(adap);
return ret;
}
/* We assume Macs have consecutive I2C bus numbers starting at 0 */
while (adap) {
do_attach(adap);
if (x.running)
return 0;
i2c_put_adapter(adap);
adap = i2c_get_adapter(++i);
}
return -ENODEV;
} }
static int static int
......
...@@ -231,7 +231,6 @@ enum i2c_alert_protocol { ...@@ -231,7 +231,6 @@ enum i2c_alert_protocol {
/** /**
* struct i2c_driver - represent an I2C device driver * struct i2c_driver - represent an I2C device driver
* @class: What kind of i2c device we instantiate (for detect) * @class: What kind of i2c device we instantiate (for detect)
* @attach_adapter: Callback for bus addition (deprecated)
* @probe: Callback for device binding - soon to be deprecated * @probe: Callback for device binding - soon to be deprecated
* @probe_new: New callback for device binding * @probe_new: New callback for device binding
* @remove: Callback for device unbinding * @remove: Callback for device unbinding
...@@ -268,11 +267,6 @@ enum i2c_alert_protocol { ...@@ -268,11 +267,6 @@ enum i2c_alert_protocol {
struct i2c_driver { struct i2c_driver {
unsigned int class; unsigned int class;
/* Notifies the driver that a new bus has appeared. You should avoid
* using this, it will be removed in a near future.
*/
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
/* Standard driver model interfaces */ /* Standard driver model interfaces */
int (*probe)(struct i2c_client *, const struct i2c_device_id *); int (*probe)(struct i2c_client *, const struct i2c_device_id *);
int (*remove)(struct i2c_client *); int (*remove)(struct i2c_client *);
......
/* /*
* i2c-ocores.h - definitions for the i2c-ocores interface * i2c-ocores.h - definitions for the i2c-ocores interface
* *
* Peter Korsgaard <jacmet@sunsite.dk> * Peter Korsgaard <peter@korsgaard.com>
* *
* This file is licensed under the terms of the GNU General Public License * This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any * version 2. This program is licensed "as is" without any warranty of any
......
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