i2c: gpio/algo-bit: clean up headers
Subsystems (2)
Wolfram Sang
maintainercover i2c: gpio/algo-bit: clean up headers
I wanted to sort headers in the i2c-gpio driver which produced a compile error. So, I had to fix i2c-algo-bit a little, too. Since there is a dependency between these patches, here is a small series.
Wolfram Sang (3):
i2c: algo-bit: include main i2c header
i2c: algo-bit: convert to SPDX header
i2c: gpio: sort includes
drivers/i2c/algos/i2c-algo-bit.c | 25 ++++++++----------------- drivers/i2c/busses/i2c-gpio.c | 10 +++++----- include/linux/i2c-algo-bit.h | 33 ++++++++++----------------------- 3 files changed, 23 insertions(+), 45 deletions(-)
Signature · 1 line
2.11.0
Wolfram Sang
maintainerPATCH 1/3 i2c: algo-bit: include main i2c header
We are using symbols from it, so we should include it directly. Found after sorting includes in a driver.
--- include/linux/i2c-algo-bit.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/i2c-algo-bit.h +2 -0
@@ -25,6 +25,8 @@#ifndef _LINUX_I2C_ALGO_BIT_H#define _LINUX_I2C_ALGO_BIT_H +#include <linux/i2c.h> +/* --- Defines for bit-adapters --------------------------------------- */ /* * This struct contains the hw-dependent functions of bit-style adapters to
Signature · 1 line
2.11.0
Re: [PATCH 1/3] i2c: algo-bit: include main i2c header
Quoted 4 lines · Wolfram Sang
We are using symbols from it, so we should include it directly. Found after sorting includes in a driver.
Signed-off-by Wolfram Sang <[email protected]>
Wolfram Sang
maintainerPATCH 2/3 i2c: algo-bit: convert to SPDX header
In reply to Wolfram SangAnd use kernel style for the remaining comments in the header.
--- drivers/i2c/algos/i2c-algo-bit.c | 25 ++++++++----------------- include/linux/i2c-algo-bit.h | 31 ++++++++----------------------- 2 files changed, 16 insertions(+), 40 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c +8 -17
@@ -1,21 +1,12 @@ -/* ------------------------------------------------------------------------- -* i2c-algo-bit.c i2c driver algorithms for bit-shift adapters -* ------------------------------------------------------------------------- +// SPDX-License-Identifier: GPL-2.0+ +/* +* i2c-algo-bit.c: i2c driver algorithms for bit-shift adapters +* * Copyright (C) 1995-2000 Simon G. Vogl - -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, or -(at your option) any later version. - -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. -* ------------------------------------------------------------------------- */ - -/* With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki -<[email protected]> and Jean Delvare <[email protected]> */ +* +* With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki +* <[email protected]> and Jean Delvare <[email protected]> +*/ #include <linux/kernel.h> #include <linux/module.h>
include/linux/i2c-algo-bit.h +8 -23
@@ -1,26 +1,11 @@ -/* ------------------------------------------------------------------------- */ -/* i2c-algo-bit.h i2c driver algorithms for bit-shift adapters */ -/* ------------------------------------------------------------------------- */ -/* Copyright (C) 1995-99 Simon G. Vogl - -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, or -(at your option) any later version. - -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. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -MA 02110-1301 USA. */ -/* ------------------------------------------------------------------------- */ - -/* With some changes from Kyösti Mälkki <[email protected]> and even -Frodo Looijaard <[email protected]> */ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* i2c-algo-bit.h: i2c driver algorithms for bit-shift adapters +* +* Copyright (C) 1995-99 Simon G. Vogl +* With some changes from Kyösti Mälkki <[email protected]> and even +* Frodo Looijaard <[email protected]> +*/ #ifndef _LINUX_I2C_ALGO_BIT_H#define _LINUX_I2C_ALGO_BIT_H
Signature · 1 line
2.11.0
Re: [PATCH 2/3] i2c: algo-bit: convert to SPDX header
Quoted 3 lines · Wolfram Sang
And use kernel style for the remaining comments in the header.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 81 lines
--- drivers/i2c/algos/i2c-algo-bit.c | 25 ++++++++----------------- include/linux/i2c-algo-bit.h | 31 ++++++++----------------------- 2 files changed, 16 insertions(+), 40 deletions(-)drivers/i2c/algos/i2c-algo-bit.c +8
-17@@ -1,21 +1,12 @@ -/* ------------------------------------------------------------------------- -* i2c-algo-bit.c i2c driver algorithms for bit-shift adapters -* ------------------------------------------------------------------------- +// SPDX-License-Identifier: GPL-2.0+ +/* +* i2c-algo-bit.c: i2c driver algorithms for bit-shift adapters +* * Copyright (C) 1995-2000 Simon G. Vogl - -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, or -(at your option) any later version. - -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. -* ------------------------------------------------------------------------- */ - -/* With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki -<[email protected]> and Jean Delvare <[email protected]> */ +* +* With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki +* <[email protected]> and Jean Delvare <[email protected]> +*/ #include <linux/kernel.h> #include <linux/module.h> include/linux/i2c-algo-bit.h +8
-23@@ -1,26 +1,11 @@ -/* ------------------------------------------------------------------------- */ -/* i2c-algo-bit.h i2c driver algorithms for bit-shift adapters */ -/* ------------------------------------------------------------------------- */ -/* Copyright (C) 1995-99 Simon G. Vogl - -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, or -(at your option) any later version. - -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. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -MA 02110-1301 USA. */ -/* ------------------------------------------------------------------------- */ - -/* With some changes from Kyösti Mälkki <[email protected]> and even -Frodo Looijaard <[email protected]> */ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* i2c-algo-bit.h: i2c driver algorithms for bit-shift adapters +* +* Copyright (C) 1995-99 Simon G. Vogl +* With some changes from Kyösti Mälkki <[email protected]> and even +* Frodo Looijaard <[email protected]> +*/ #ifndef _LINUX_I2C_ALGO_BIT_H#define _LINUX_I2C_ALGO_BIT_HSignature · 1 line
2.11.0
Wolfram Sang
maintainerPATCH 3/3 i2c: gpio: sort includes
In reply to Wolfram SangLess risk for duplications when adding new ones.
--- drivers/i2c/busses/i2c-gpio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/i2c/busses/i2c-gpio.c +5 -5
@@ -9,15 +9,15 @@*/ #include <linux/debugfs.h> #include <linux/delay.h> -#include <linux/i2c.h> +#include <linux/gpio/consumer.h> #include <linux/i2c-algo-bit.h> -#include <linux/platform_data/i2c-gpio.h> +#include <linux/i2c.h> #include <linux/init.h> #include <linux/module.h> -#include <linux/slab.h> -#include <linux/platform_device.h> -#include <linux/gpio/consumer.h> #include <linux/of.h> +#include <linux/platform_data/i2c-gpio.h> +#include <linux/platform_device.h> +#include <linux/slab.h> struct i2c_gpio_private_data {struct gpio_desc *sda;
Signature · 1 line
2.11.0
Re: [PATCH 3/3] i2c: gpio: sort includes
Quoted 3 lines · Wolfram Sang
Less risk for duplications when adding new ones.
Signed-off-by Wolfram Sang <[email protected]>
Quoted 32 lines
--- drivers/i2c/busses/i2c-gpio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/i2c/busses/i2c-gpio.c +5
-5@@ -9,15 +9,15 @@*/ #include <linux/debugfs.h> #include <linux/delay.h> -#include <linux/i2c.h> +#include <linux/gpio/consumer.h> #include <linux/i2c-algo-bit.h> -#include <linux/platform_data/i2c-gpio.h> +#include <linux/i2c.h> #include <linux/init.h> #include <linux/module.h> -#include <linux/slab.h> -#include <linux/platform_device.h> -#include <linux/gpio/consumer.h> #include <linux/of.h> +#include <linux/platform_data/i2c-gpio.h> +#include <linux/platform_device.h> +#include <linux/slab.h> struct i2c_gpio_private_data {struct gpio_desc *sda;Signature · 1 line
2.11.0
Wolfram Sang
AppliedQuoted 8 lines · Wolfram Sang
I wanted to sort headers in the i2c-gpio driver which produced a compile error. So, I had to fix i2c-algo-bit a little, too. Since there is a dependency between these patches, here is a small series.
Wolfram Sang (3):
i2c: algo-bit: include main i2c header
i2c: algo-bit: convert to SPDX header
i2c: gpio: sort includes
Applied to for-next, thanks!