[PATCH v2] xfs: Use the correct style for SPDX License Identifier

2020-05-02 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style in header files
related to XFS File System support. For C header files
Documentation/process/license-rules.rst mandates C-like comments.
(opposed to C source files where C++ style should be used).

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - use up all 73 chars in commit description
---
 fs/xfs/kmem.h  | 2 +-
 fs/xfs/libxfs/xfs_ag_resv.h| 2 +-
 fs/xfs/libxfs/xfs_alloc.h  | 2 +-
 fs/xfs/libxfs/xfs_alloc_btree.h| 2 +-
 fs/xfs/libxfs/xfs_attr.h   | 2 +-
 fs/xfs/libxfs/xfs_attr_leaf.h  | 2 +-
 fs/xfs/libxfs/xfs_attr_remote.h| 2 +-
 fs/xfs/libxfs/xfs_attr_sf.h| 2 +-
 fs/xfs/libxfs/xfs_bit.h| 2 +-
 fs/xfs/libxfs/xfs_bmap.h   | 2 +-
 fs/xfs/libxfs/xfs_bmap_btree.h | 2 +-
 fs/xfs/libxfs/xfs_btree.h  | 2 +-
 fs/xfs/libxfs/xfs_da_btree.h   | 2 +-
 fs/xfs/libxfs/xfs_da_format.h  | 2 +-
 fs/xfs/libxfs/xfs_defer.h  | 2 +-
 fs/xfs/libxfs/xfs_dir2.h   | 2 +-
 fs/xfs/libxfs/xfs_dir2_priv.h  | 2 +-
 fs/xfs/libxfs/xfs_errortag.h   | 2 +-
 fs/xfs/libxfs/xfs_format.h | 2 +-
 fs/xfs/libxfs/xfs_fs.h | 2 +-
 fs/xfs/libxfs/xfs_health.h | 2 +-
 fs/xfs/libxfs/xfs_ialloc.h | 2 +-
 fs/xfs/libxfs/xfs_ialloc_btree.h   | 2 +-
 fs/xfs/libxfs/xfs_inode_buf.h  | 2 +-
 fs/xfs/libxfs/xfs_inode_fork.h | 2 +-
 fs/xfs/libxfs/xfs_log_format.h | 2 +-
 fs/xfs/libxfs/xfs_log_recover.h| 2 +-
 fs/xfs/libxfs/xfs_quota_defs.h | 2 +-
 fs/xfs/libxfs/xfs_refcount.h   | 2 +-
 fs/xfs/libxfs/xfs_refcount_btree.h | 2 +-
 fs/xfs/libxfs/xfs_rmap.h   | 2 +-
 fs/xfs/libxfs/xfs_rmap_btree.h | 2 +-
 fs/xfs/libxfs/xfs_sb.h | 2 +-
 fs/xfs/libxfs/xfs_shared.h | 2 +-
 fs/xfs/libxfs/xfs_trans_resv.h | 2 +-
 fs/xfs/libxfs/xfs_trans_space.h| 2 +-
 fs/xfs/libxfs/xfs_types.h  | 2 +-
 fs/xfs/mrlock.h| 2 +-
 fs/xfs/scrub/bitmap.h  | 2 +-
 fs/xfs/scrub/btree.h   | 2 +-
 fs/xfs/scrub/common.h  | 2 +-
 fs/xfs/scrub/dabtree.h | 2 +-
 fs/xfs/scrub/health.h  | 2 +-
 fs/xfs/scrub/repair.h  | 2 +-
 fs/xfs/scrub/scrub.h   | 2 +-
 fs/xfs/scrub/trace.h   | 2 +-
 fs/xfs/scrub/xfs_scrub.h   | 2 +-
 fs/xfs/xfs.h   | 2 +-
 fs/xfs/xfs_acl.h   | 2 +-
 fs/xfs/xfs_aops.h  | 2 +-
 fs/xfs/xfs_bmap_item.h | 2 +-
 fs/xfs/xfs_bmap_util.h | 2 +-
 fs/xfs/xfs_buf.h   | 2 +-
 fs/xfs/xfs_buf_item.h  | 2 +-
 fs/xfs/xfs_dquot.h | 2 +-
 fs/xfs/xfs_dquot_item.h| 2 +-
 fs/xfs/xfs_error.h | 2 +-
 fs/xfs/xfs_export.h| 2 +-
 fs/xfs/xfs_extent_busy.h   | 2 +-
 fs/xfs/xfs_extfree_item.h  | 2 +-
 fs/xfs/xfs_filestream.h| 2 +-
 fs/xfs/xfs_fsmap.h | 2 +-
 fs/xfs/xfs_fsops.h | 2 +-
 fs/xfs/xfs_icache.h| 2 +-
 fs/xfs/xfs_icreate_item.h  | 2 +-
 fs/xfs/xfs_inode.h | 2 +-
 fs/xfs/xfs_inode_item.h| 2 +-
 fs/xfs/xfs_ioctl.h | 2 +-
 fs/xfs/xfs_ioctl32.h   | 2 +-
 fs/xfs/xfs_iomap.h | 2 +-
 fs/xfs/xfs_iops.h  | 2 +-
 fs/xfs/xfs_itable.h| 2 +-
 fs/xfs/xfs_linux.h | 2 +-
 fs/xfs/xfs_log.h   | 2 +-
 fs/xfs/xfs_log_priv.h  | 2 +-
 fs/xfs/xfs_mount.h | 2 +-
 fs/xfs/xfs_mru_cache.h | 2 +-
 fs/xfs/xfs_ondisk.h| 2 +-
 fs/xfs/xfs_qm.h| 2 +-
 fs/xfs/xfs_quota.h | 2 +-
 fs/xfs/xfs_refcount_item.h | 2 +-
 fs/xfs/xfs_reflink.h   | 2 +-
 fs/xfs/xfs_rmap_item.h | 2 +-
 fs/xfs/xfs_rtalloc.h   | 2 +-
 fs/xfs/xfs_stats.h | 2 +-
 fs/xfs/xfs_super.h | 2 +-
 fs/xfs/xfs_symlink.h   | 2 +-
 fs/xfs/xfs_sysctl.h| 2 +-
 fs/xfs/xfs_sysfs.h | 2 +-
 fs/xfs/xfs_trace.h | 2 +-
 fs/xfs/xfs_trans.h | 2 +-
 fs/xfs/xfs_trans_priv.h| 2 +-
 92 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h
index 6143117770e9..fc87ea9f6843 100644
--- a/fs/xfs/kmem.h
+++ b/fs/xfs/kmem.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2000-2005 Silicon Graphics, Inc.
  * All Rights Reserved.
diff --git a/fs/xfs/libxfs/xfs_ag_resv.h b/fs/xfs/libxfs/xfs_ag_resv.h
index c0352edc8e41..f3fd0ee9a7f7 100644
--- a/fs/xfs/libxfs/xfs_ag_resv.h
+++ b/fs/xfs/libxfs/xfs_ag_resv.h
@@ -1,4 +1,4 @@
-// SPDX-License

Re: [PATCH] xfs: Use the correct style for SPDX License Identifier

2020-05-02 Thread Nishad Kamdar
On Mon, Apr 27, 2020 at 12:25:27AM -0700, Christoph Hellwig wrote:
> On Sat, Apr 25, 2020 at 07:05:09PM +0530, Nishad Kamdar wrote:
> > This patch corrects the SPDX License Identifier style in
> > header files related to XFS File System support.
> > For C header files Documentation/process/license-rules.rst
> > mandates C-like comments (opposed to C source files where
> > C++ style should be used).
> > 
> > Changes made by using a script provided by Joe Perches here:
> > https://lkml.org/lkml/2019/2/7/46.
> 
> Please use up all 73 chars in your commit logs.

Ok, I'll do that.

Thanks for the review.

Regards,
Nishad


[PATCH] net: ethernet: Use the correct style for SPDX License Identifier

2019-10-23 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style in
header file related to ethernet driver for Cortina Gemini
devices. For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/net/ethernet/cortina/gemini.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cortina/gemini.h 
b/drivers/net/ethernet/cortina/gemini.h
index 0b12f89bf89a..9fdf77d5eb37 100644
--- a/drivers/net/ethernet/cortina/gemini.h
+++ b/drivers/net/ethernet/cortina/gemini.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /* Register definitions for Gemini GMAC Ethernet device driver
  *
  * Copyright (C) 2006 Storlink, Corp.
-- 
2.17.1



[PATCH v2] net: dsa: sja1105: Use the correct style for SPDX License Identifier

2019-10-14 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Distributed Switch Architecture
drivers for NXP SJA1105 series Ethernet switch support.
It uses an expilict block comment for the SPDX License
Identifier.

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
Changes in v2:
  - Modify the commit message to reflect the changes done.
  - Correct some indentation errors.
---
 drivers/net/dsa/sja1105/sja1105.h| 4 ++--
 drivers/net/dsa/sja1105/sja1105_dynamic_config.h | 4 ++--
 drivers/net/dsa/sja1105/sja1105_ptp.h| 4 ++--
 drivers/net/dsa/sja1105/sja1105_static_config.h  | 4 ++--
 drivers/net/dsa/sja1105/sja1105_tas.h| 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/dsa/sja1105/sja1105.h 
b/drivers/net/dsa/sja1105/sja1105.h
index 8681ff9d1a76..b0dada13c377 100644
--- a/drivers/net/dsa/sja1105/sja1105.h
+++ b/drivers/net/dsa/sja1105/sja1105.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
  * Copyright (c) 2018-2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_H
diff --git a/drivers/net/dsa/sja1105/sja1105_dynamic_config.h 
b/drivers/net/dsa/sja1105/sja1105_dynamic_config.h
index 740dadf43f01..1fc0d13dc623 100644
--- a/drivers/net/dsa/sja1105/sja1105_dynamic_config.h
+++ b/drivers/net/dsa/sja1105/sja1105_dynamic_config.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2019, Vladimir Oltean 
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_DYNAMIC_CONFIG_H
 #define _SJA1105_DYNAMIC_CONFIG_H
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.h 
b/drivers/net/dsa/sja1105/sja1105_ptp.h
index af456b0a4d27..394e12a6ad59 100644
--- a/drivers/net/dsa/sja1105/sja1105_ptp.h
+++ b/drivers/net/dsa/sja1105/sja1105_ptp.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2019, Vladimir Oltean 
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_PTP_H
 #define _SJA1105_PTP_H
diff --git a/drivers/net/dsa/sja1105/sja1105_static_config.h 
b/drivers/net/dsa/sja1105/sja1105_static_config.h
index 7f87022a2d61..f4a5c5c04311 100644
--- a/drivers/net/dsa/sja1105/sja1105_static_config.h
+++ b/drivers/net/dsa/sja1105/sja1105_static_config.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright (c) 2016-2018, NXP Semiconductors
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2016-2018, NXP Semiconductors
  * Copyright (c) 2018-2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_STATIC_CONFIG_H
diff --git a/drivers/net/dsa/sja1105/sja1105_tas.h 
b/drivers/net/dsa/sja1105/sja1105_tas.h
index 0b803c30e640..0aad212d88b2 100644
--- a/drivers/net/dsa/sja1105/sja1105_tas.h
+++ b/drivers/net/dsa/sja1105/sja1105_tas.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2019, Vladimir Oltean 
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_TAS_H
 #define _SJA1105_TAS_H
-- 
2.17.1



Re: [PATCH] net: dsa: sja1105: Use the correct style for SPDX License Identifier

2019-10-14 Thread Nishad Kamdar
On Mon, Oct 14, 2019 at 03:00:16PM +0200, Andrew Lunn wrote:
> On Mon, Oct 14, 2019 at 01:46:26PM +0300, Vladimir Oltean wrote:
> > Hi Nishad,
> > 
> > On Sat, 12 Oct 2019 at 15:39, Nishad Kamdar  wrote:
> > >
> > > This patch corrects the SPDX License Identifier style
> > > in header files related to Distributed Switch Architecture
> > > drivers for NXP SJA1105 series Ethernet switch support.
> > > For C header files Documentation/process/license-rules.rst
> > > mandates C-like comments (opposed to C source files where
> > > C++ style should be used)
> > >
> > > Changes made by using a script provided by Joe Perches here:
> > > https://lkml.org/lkml/2019/2/7/46.
> > >
> > > Suggested-by: Joe Perches 
> > > Signed-off-by: Nishad Kamdar 
> > > ---
> > 
> > Your commit message has nothing to do with what you're fixing, but
> > whatever. The SPDX identifiers _are_ using C-like comments.
> 
> Agreed. Please fix the commit message, and maybe make the script
> generating the commit message, so future uses of it will get the
> message correct.
> 
> Thanks
>   Andrew
Hello Andrew and Vladimir,

I understand your comments.
I will change the commit message in the next version of the patch.

Thanks for the review.

Regards,
Nishad


[PATCH] net: cavium: Use the correct style for SPDX License Identifier

2019-10-12 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Cavium Ethernet drivers.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/net/ethernet/cavium/common/cavium_ptp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/common/cavium_ptp.h 
b/drivers/net/ethernet/cavium/common/cavium_ptp.h
index be2bafc7beeb..a04eccbc78e8 100644
--- a/drivers/net/ethernet/cavium/common/cavium_ptp.h
+++ b/drivers/net/ethernet/cavium/common/cavium_ptp.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /* cavium_ptp.h - PTP 1588 clock on Cavium hardware
  * Copyright (c) 2003-2015, 2017 Cavium, Inc.
  */
-- 
2.17.1



[PATCH] net: dsa: sja1105: Use the correct style for SPDX License Identifier

2019-10-12 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Distributed Switch Architecture
drivers for NXP SJA1105 series Ethernet switch support.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/net/dsa/sja1105/sja1105.h| 4 ++--
 drivers/net/dsa/sja1105/sja1105_dynamic_config.h | 4 ++--
 drivers/net/dsa/sja1105/sja1105_ptp.h| 4 ++--
 drivers/net/dsa/sja1105/sja1105_static_config.h  | 4 ++--
 drivers/net/dsa/sja1105/sja1105_tas.h| 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/dsa/sja1105/sja1105.h 
b/drivers/net/dsa/sja1105/sja1105.h
index 8681ff9d1a76..fb7a6fff643f 100644
--- a/drivers/net/dsa/sja1105/sja1105.h
+++ b/drivers/net/dsa/sja1105/sja1105.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
+/* SPDX-License-Identifier: GPL-2.0 */
+/*  Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
  * Copyright (c) 2018-2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_H
diff --git a/drivers/net/dsa/sja1105/sja1105_dynamic_config.h 
b/drivers/net/dsa/sja1105/sja1105_dynamic_config.h
index 740dadf43f01..4f64adb2d26a 100644
--- a/drivers/net/dsa/sja1105/sja1105_dynamic_config.h
+++ b/drivers/net/dsa/sja1105/sja1105_dynamic_config.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2019, Vladimir Oltean 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*  Copyright (c) 2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_DYNAMIC_CONFIG_H
 #define _SJA1105_DYNAMIC_CONFIG_H
diff --git a/drivers/net/dsa/sja1105/sja1105_ptp.h 
b/drivers/net/dsa/sja1105/sja1105_ptp.h
index af456b0a4d27..c7e598fd1504 100644
--- a/drivers/net/dsa/sja1105/sja1105_ptp.h
+++ b/drivers/net/dsa/sja1105/sja1105_ptp.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2019, Vladimir Oltean 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*  Copyright (c) 2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_PTP_H
 #define _SJA1105_PTP_H
diff --git a/drivers/net/dsa/sja1105/sja1105_static_config.h 
b/drivers/net/dsa/sja1105/sja1105_static_config.h
index 7f87022a2d61..ee66fae6128b 100644
--- a/drivers/net/dsa/sja1105/sja1105_static_config.h
+++ b/drivers/net/dsa/sja1105/sja1105_static_config.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright (c) 2016-2018, NXP Semiconductors
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*  Copyright (c) 2016-2018, NXP Semiconductors
  * Copyright (c) 2018-2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_STATIC_CONFIG_H
diff --git a/drivers/net/dsa/sja1105/sja1105_tas.h 
b/drivers/net/dsa/sja1105/sja1105_tas.h
index 0b803c30e640..c3ea7be52b9c 100644
--- a/drivers/net/dsa/sja1105/sja1105_tas.h
+++ b/drivers/net/dsa/sja1105/sja1105_tas.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Copyright (c) 2019, Vladimir Oltean 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*  Copyright (c) 2019, Vladimir Oltean 
  */
 #ifndef _SJA1105_TAS_H
 #define _SJA1105_TAS_H
-- 
2.17.1



[PATCH] net: dsa: microchip: Use the correct style for SPDX License Identifier

2019-10-12 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Distributed Switch Architecture
drivers for Microchip KSZ series switch support.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/net/dsa/microchip/ksz9477_reg.h | 4 ++--
 drivers/net/dsa/microchip/ksz_common.h  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/microchip/ksz9477_reg.h 
b/drivers/net/dsa/microchip/ksz9477_reg.h
index 2938e892b631..16939f29faa5 100644
--- a/drivers/net/dsa/microchip/ksz9477_reg.h
+++ b/drivers/net/dsa/microchip/ksz9477_reg.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
  * Microchip KSZ9477 register definitions
  *
  * Copyright (C) 2017-2018 Microchip Technology Inc.
diff --git a/drivers/net/dsa/microchip/ksz_common.h 
b/drivers/net/dsa/microchip/ksz_common.h
index dd60d0837fc6..64c2677693d2 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- * Microchip switch driver common header
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Microchip switch driver common header
  *
  * Copyright (C) 2017-2019 Microchip Technology Inc.
  */
-- 
2.17.1



[tip: core/urgent] x86: Use the correct SPDX License Identifier in headers

2019-10-01 Thread tip-bot2 for Nishad Kamdar
The following commit has been merged into the core/urgent branch of tip:

Commit-ID: 6184488a19be96d89cb6c36fb4bc277198309484
Gitweb:
https://git.kernel.org/tip/6184488a19be96d89cb6c36fb4bc277198309484
Author:Nishad Kamdar 
AuthorDate:Tue, 16 Apr 2019 21:16:14 +05:30
Committer: Borislav Petkov 
CommitterDate: Tue, 01 Oct 2019 20:31:35 +02:00

x86: Use the correct SPDX License Identifier in headers

Correct the SPDX License Identifier format in a couple of headers.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
Signed-off-by: Borislav Petkov 
Cc: Greg Kroah-Hartman 
Cc: "H. Peter Anvin" 
Cc: Ingo Molnar 
Cc: Sean Christopherson 
Cc: Thomas Gleixner 
Cc: Uwe Kleine-König 
Cc: Waiman Long 
Cc: x86-ml 
Link: 
https://lkml.kernel.org/r/697848ff866ade29e78e872525d7a3067642fd37.1555427420.git.nishadkam...@gmail.com
---
 arch/x86/include/asm/cpu_entry_area.h | 2 +-
 arch/x86/include/asm/pti.h| 2 +-
 arch/x86/kernel/process.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/cpu_entry_area.h 
b/arch/x86/include/asm/cpu_entry_area.h
index cff3f3f..8348f7d 100644
--- a/arch/x86/include/asm/cpu_entry_area.h
+++ b/arch/x86/include/asm/cpu_entry_area.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 
 #ifndef _ASM_X86_CPU_ENTRY_AREA_H
 #define _ASM_X86_CPU_ENTRY_AREA_H
diff --git a/arch/x86/include/asm/pti.h b/arch/x86/include/asm/pti.h
index 5df09a0..07375b4 100644
--- a/arch/x86/include/asm/pti.h
+++ b/arch/x86/include/asm/pti.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _ASM_X86_PTI_H
 #define _ASM_X86_PTI_H
 #ifndef __ASSEMBLY__
diff --git a/arch/x86/kernel/process.h b/arch/x86/kernel/process.h
index 320ab97..1d0797b 100644
--- a/arch/x86/kernel/process.h
+++ b/arch/x86/kernel/process.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Code shared between 32 and 64 bit
 


[PATCH] net: dsa: Use the correct style for SPDX License Identifier

2019-09-21 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file for Distributed Switch Architecture drivers.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/net/dsa/lantiq_pce.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/lantiq_pce.h b/drivers/net/dsa/lantiq_pce.h
index 180663138e75..e2be31f3672a 100644
--- a/drivers/net/dsa/lantiq_pce.h
+++ b/drivers/net/dsa/lantiq_pce.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * PCE microcode extracted from UGW 7.1.1 switch api
  *
-- 
2.17.1



[PATCH] net: dsa: b53: Use the correct style for SPDX License Identifier

2019-09-21 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file for Broadcom BCM53xx managed switch driver.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/net/dsa/b53/b53_serdes.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_serdes.h b/drivers/net/dsa/b53/b53_serdes.h
index 3bb4f91aec9e..55d280fe38e4 100644
--- a/drivers/net/dsa/b53/b53_serdes.h
+++ b/drivers/net/dsa/b53/b53_serdes.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause
- *
+/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
+/*
  * Northstar Plus switch SerDes/SGMII PHY definitions
  *
  * Copyright (C) 2018 Florian Fainelli 
-- 
2.17.1



[PATCH] ocxl: Use the correct style for SPDX License Identifier

2019-09-20 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files for Open Coherent Accelerator (OCXL) compatible device
drivers. For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/misc/ocxl/ocxl_internal.h | 2 +-
 drivers/misc/ocxl/trace.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/ocxl/ocxl_internal.h 
b/drivers/misc/ocxl/ocxl_internal.h
index 97415afd79f3..345bf843a38e 100644
--- a/drivers/misc/ocxl/ocxl_internal.h
+++ b/drivers/misc/ocxl/ocxl_internal.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 // Copyright 2017 IBM Corp.
 #ifndef _OCXL_INTERNAL_H_
 #define _OCXL_INTERNAL_H_
diff --git a/drivers/misc/ocxl/trace.h b/drivers/misc/ocxl/trace.h
index 024f417e7e01..17e21cb2addd 100644
--- a/drivers/misc/ocxl/trace.h
+++ b/drivers/misc/ocxl/trace.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 // Copyright 2017 IBM Corp.
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM ocxl
-- 
2.17.1



[PATCH] misc: Use the correct style for SPDX License Identifier

2019-09-20 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files for Miscellaneous device drivers.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/misc/hpilo.h  | 2 +-
 drivers/misc/ibmvmc.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/hpilo.h b/drivers/misc/hpilo.h
index 94dfb9e40e29..1aa433a7f66c 100644
--- a/drivers/misc/hpilo.h
+++ b/drivers/misc/hpilo.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * linux/drivers/char/hpilo.h
  *
diff --git a/drivers/misc/ibmvmc.h b/drivers/misc/ibmvmc.h
index e140ada8fe2c..0e1756fffeae 100644
--- a/drivers/misc/ibmvmc.h
+++ b/drivers/misc/ibmvmc.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0+
- *
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
  * linux/drivers/misc/ibmvmc.h
  *
  * IBM Power Systems Virtual Management Channel Support.
-- 
2.17.1



[PATCH] media: usb: tm6000: Use the correct style for SPDX License Identifier

2019-09-16 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files for TV Master Media USB Adapter drivers.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/media/usb/tm6000/tm6000-regs.h | 2 +-
 drivers/media/usb/tm6000/tm6000-usb-isoc.h | 2 +-
 drivers/media/usb/tm6000/tm6000.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/tm6000/tm6000-regs.h 
b/drivers/media/usb/tm6000/tm6000-regs.h
index d10424673db9..6a181f2e7ef2 100644
--- a/drivers/media/usb/tm6000/tm6000-regs.h
+++ b/drivers/media/usb/tm6000/tm6000-regs.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * SPDX-License-Identifier: GPL-2.0
  * tm6000-regs.h - driver for TM5600/TM6000/TM6010 USB video capture devices
  *
  * Copyright (c) 2006-2007 Mauro Carvalho Chehab 
diff --git a/drivers/media/usb/tm6000/tm6000-usb-isoc.h 
b/drivers/media/usb/tm6000/tm6000-usb-isoc.h
index b275dbce3a1b..e3c6933f854d 100644
--- a/drivers/media/usb/tm6000/tm6000-usb-isoc.h
+++ b/drivers/media/usb/tm6000/tm6000-usb-isoc.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * SPDX-License-Identifier: GPL-2.0
  * tm6000-buf.c - driver for TM5600/TM6000/TM6010 USB video capture devices
  *
  * Copyright (c) 2006-2007 Mauro Carvalho Chehab 
diff --git a/drivers/media/usb/tm6000/tm6000.h 
b/drivers/media/usb/tm6000/tm6000.h
index bf396544da9a..c08c95312739 100644
--- a/drivers/media/usb/tm6000/tm6000.h
+++ b/drivers/media/usb/tm6000/tm6000.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * SPDX-License-Identifier: GPL-2.0
  * tm6000.h - driver for TM5600/TM6000/TM6010 USB video capture devices
  *
  * Copyright (c) 2006-2007 Mauro Carvalho Chehab 
-- 
2.17.1



[PATCH] media: tuners: Use the correct style for SPDX License Identifier

2019-09-15 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file related to media Drivers for Analog TV Tuners.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/media/tuners/tuner-xc2028-types.h | 2 +-
 drivers/media/tuners/tuner-xc2028.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/tuners/tuner-xc2028-types.h 
b/drivers/media/tuners/tuner-xc2028-types.h
index 50d017a4822a..fcca39d3e006 100644
--- a/drivers/media/tuners/tuner-xc2028-types.h
+++ b/drivers/media/tuners/tuner-xc2028-types.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * SPDX-License-Identifier: GPL-2.0
  * tuner-xc2028_types
  *
  * This file includes internal tipes to be used inside tuner-xc2028.
diff --git a/drivers/media/tuners/tuner-xc2028.h 
b/drivers/media/tuners/tuner-xc2028.h
index 7b58bc06e35c..2dd45d0765d7 100644
--- a/drivers/media/tuners/tuner-xc2028.h
+++ b/drivers/media/tuners/tuner-xc2028.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * SPDX-License-Identifier: GPL-2.0
  * tuner-xc2028
  *
  * Copyright (c) 2007-2008 Mauro Carvalho Chehab 
-- 
2.17.1



[PATCH] media: rc: Use the correct style for SPDX License Identifier

2019-09-15 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file related to Remote Controller Driver for Linux.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/media/rc/rc-core-priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h
index 9f21b3e8b377..5f36244cc34f 100644
--- a/drivers/media/rc/rc-core-priv.h
+++ b/drivers/media/rc/rc-core-priv.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * SPDX-License-Identifier: GPL-2.0
  * Remote Controller core raw events header
  *
  * Copyright (C) 2010 by Mauro Carvalho Chehab
-- 
2.17.1



[PATCH] media: xilinx: Use the correct style for SPDX License Identifier

2019-09-07 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Video drivers for Xilinx devices.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/media/platform/xilinx/xilinx-dma.h  | 2 +-
 drivers/media/platform/xilinx/xilinx-vip.h  | 2 +-
 drivers/media/platform/xilinx/xilinx-vipp.h | 2 +-
 drivers/media/platform/xilinx/xilinx-vtc.h  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/xilinx/xilinx-dma.h 
b/drivers/media/platform/xilinx/xilinx-dma.h
index 5aec4d17eb21..2378bdae57ae 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.h
+++ b/drivers/media/platform/xilinx/xilinx-dma.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Xilinx Video DMA
  *
diff --git a/drivers/media/platform/xilinx/xilinx-vip.h 
b/drivers/media/platform/xilinx/xilinx-vip.h
index f71e2b650453..a528a32ea1dc 100644
--- a/drivers/media/platform/xilinx/xilinx-vip.h
+++ b/drivers/media/platform/xilinx/xilinx-vip.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Xilinx Video IP Core
  *
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.h 
b/drivers/media/platform/xilinx/xilinx-vipp.h
index e65fce9538f9..cc52c1854dbd 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.h
+++ b/drivers/media/platform/xilinx/xilinx-vipp.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Xilinx Video IP Composite Device
  *
diff --git a/drivers/media/platform/xilinx/xilinx-vtc.h 
b/drivers/media/platform/xilinx/xilinx-vtc.h
index 90cf44245283..855845911ffc 100644
--- a/drivers/media/platform/xilinx/xilinx-vtc.h
+++ b/drivers/media/platform/xilinx/xilinx-vtc.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Xilinx Video Timing Controller
  *
-- 
2.17.1



[PATCH] media: i2c: Use the correct style for SPDX License Identifier

2019-09-04 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to I2C controlled media codec drivers.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46
and some manual changes.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/media/i2c/max2175.h   | 4 ++--
 drivers/media/i2c/saa711x_regs.h  | 2 +-
 drivers/media/i2c/tda1997x_regs.h | 2 +-
 drivers/media/i2c/tvp5150_reg.h   | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/max2175.h b/drivers/media/i2c/max2175.h
index 1ece587c153d..4c722ea3e5f1 100644
--- a/drivers/media/i2c/max2175.h
+++ b/drivers/media/i2c/max2175.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
  * Maxim Integrated MAX2175 RF to Bits tuner driver
  *
  * This driver & most of the hard coded values are based on the reference
diff --git a/drivers/media/i2c/saa711x_regs.h b/drivers/media/i2c/saa711x_regs.h
index 44fabe08234d..4b5f6985710b 100644
--- a/drivers/media/i2c/saa711x_regs.h
+++ b/drivers/media/i2c/saa711x_regs.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * SPDX-License-Identifier: GPL-2.0+
  * saa711x - Philips SAA711x video decoder register specifications
  *
  * Copyright (c) 2006 Mauro Carvalho Chehab 
diff --git a/drivers/media/i2c/tda1997x_regs.h 
b/drivers/media/i2c/tda1997x_regs.h
index ecf87534613b..d9b3daada07d 100644
--- a/drivers/media/i2c/tda1997x_regs.h
+++ b/drivers/media/i2c/tda1997x_regs.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2018 Gateworks Corporation
  */
diff --git a/drivers/media/i2c/tvp5150_reg.h b/drivers/media/i2c/tvp5150_reg.h
index 9088186c24d1..f716129adf09 100644
--- a/drivers/media/i2c/tvp5150_reg.h
+++ b/drivers/media/i2c/tvp5150_reg.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
- * SPDX-License-Identifier: GPL-2.0
  *
  * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers
  *
-- 
2.17.1



[PATCH] media: siano: Use the correct style for SPDX License Identifier

2019-08-31 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file related to Siano Mobile Silicon Digital TV.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/media/common/siano/smsir.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/common/siano/smsir.h 
b/drivers/media/common/siano/smsir.h
index b2c54c256e86..ada41d5c4e83 100644
--- a/drivers/media/common/siano/smsir.h
+++ b/drivers/media/common/siano/smsir.h
@@ -1,5 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * SPDX-License-Identifier: GPL-2.0+
  *
  * Siano Mobile Silicon, Inc.
  * MDTV receiver kernel modules.
-- 
2.17.1



[PATCH] i2c: stm32: Use the correct style for SPDX License Identifier

2019-08-03 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file related to STM32 Driver for I2C hardware
bus support.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/i2c/busses/i2c-stm32.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-stm32.h b/drivers/i2c/busses/i2c-stm32.h
index 868755f82f88..2c21893905a3 100644
--- a/drivers/i2c/busses/i2c-stm32.h
+++ b/drivers/i2c/busses/i2c-stm32.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * i2c-stm32.h
  *
-- 
2.17.1



[PATCH] intel_th: Use the correct style for SPDX License Identifier

2019-07-26 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Drivers for Intel(R) Trace Hub
controller.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/hwtracing/intel_th/msu.h | 2 +-
 drivers/hwtracing/intel_th/pti.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/intel_th/msu.h b/drivers/hwtracing/intel_th/msu.h
index 3f527dd4d727..e771f509bd02 100644
--- a/drivers/hwtracing/intel_th/msu.h
+++ b/drivers/hwtracing/intel_th/msu.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Intel(R) Trace Hub Memory Storage Unit (MSU) data structures
  *
diff --git a/drivers/hwtracing/intel_th/pti.h b/drivers/hwtracing/intel_th/pti.h
index e9381babc84c..7dfc0431333b 100644
--- a/drivers/hwtracing/intel_th/pti.h
+++ b/drivers/hwtracing/intel_th/pti.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Intel(R) Trace Hub PTI output data structures
  *
-- 
2.17.1



[PATCH] hv: Use the correct style for SPDX License Identifier

2019-07-22 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the trace header file related to Microsoft Hyper-V
client drivers.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/hv/hv_trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hv/hv_trace.h b/drivers/hv/hv_trace.h
index 999f80a63bff..e70783e33680 100644
--- a/drivers/hv/hv_trace.h
+++ b/drivers/hv/hv_trace.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM hyperv
-- 
2.17.1



[PATCH] fsi: cf-fsi-fw: Use the correct style for SPDX License Identifier

2019-06-14 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file related to Drivers for FRU Support Interface.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/fsi/cf-fsi-fw.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fsi/cf-fsi-fw.h b/drivers/fsi/cf-fsi-fw.h
index 712df0461911..1118eaf7ee39 100644
--- a/drivers/fsi/cf-fsi-fw.h
+++ b/drivers/fsi/cf-fsi-fw.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 #ifndef __CF_FSI_FW_H
 #define __CF_FSI_FW_H
 
-- 
2.17.1



[PATCH] firmware: ti_sci: Use the correct style for SPDX License Identifier

2019-06-14 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file related to Firmware Drivers for Texas
Instruments SCI Protocol.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/firmware/ti_sci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h
index 662dcffef311..d7b4cd3fce8f 100644
--- a/drivers/firmware/ti_sci.h
+++ b/drivers/firmware/ti_sci.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause */
 /*
  * Texas Instruments System Control Interface (TISCI) Protocol
  *
-- 
2.17.1



[PATCH] firmware: arm_scmi: Use the correct style for SPDX License Identifier

2019-06-13 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header file related to Firmware Drivers for ARM SCMI
Message Protocol.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/firmware/arm_scmi/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/common.h 
b/drivers/firmware/arm_scmi/common.h
index 937a930ce87d..44fd4f9404a9 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * System Control and Management Interface (SCMI) Message Protocol
  * driver common header file containing some definitions, structures
-- 
2.17.1



[PATCH] clk: sunxi-ng: Use the correct style for SPDX License Identifier

2019-05-01 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Clock Drivers for Allwinner SoCs.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/clk/sunxi-ng/ccu-sun50i-h6.h | 2 +-
 drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.h 
b/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
index 2ccfe4428260..9406f9a6a8aa 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright 2016 Icenowy Zheng 
  */
diff --git a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h 
b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h
index 39d06fed55b2..b22484f1bb9a 100644
--- a/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h
+++ b/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0+
- *
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
  * Copyright 2017 Icenowy Zheng 
  *
  */
-- 
2.17.1



[PATCH] clk: sprd: Use the correct style for SPDX License Identifier

2019-05-01 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Clock Drivers for Spreadtrum SoCs.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/clk/sprd/common.h| 2 +-
 drivers/clk/sprd/composite.h | 2 +-
 drivers/clk/sprd/div.h   | 2 +-
 drivers/clk/sprd/gate.h  | 2 +-
 drivers/clk/sprd/mux.h   | 2 +-
 drivers/clk/sprd/pll.h   | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/sprd/common.h b/drivers/clk/sprd/common.h
index abd9ff5ef448..1d077b39cef6 100644
--- a/drivers/clk/sprd/common.h
+++ b/drivers/clk/sprd/common.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Spreadtrum clock infrastructure
 //
diff --git a/drivers/clk/sprd/composite.h b/drivers/clk/sprd/composite.h
index 0984e9e252dc..04ab3f587ee2 100644
--- a/drivers/clk/sprd/composite.h
+++ b/drivers/clk/sprd/composite.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Spreadtrum composite clock driver
 //
diff --git a/drivers/clk/sprd/div.h b/drivers/clk/sprd/div.h
index b3033d24d431..87510e3d0e14 100644
--- a/drivers/clk/sprd/div.h
+++ b/drivers/clk/sprd/div.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Spreadtrum divider clock driver
 //
diff --git a/drivers/clk/sprd/gate.h b/drivers/clk/sprd/gate.h
index 2e582c68a08b..dc352ea55e1f 100644
--- a/drivers/clk/sprd/gate.h
+++ b/drivers/clk/sprd/gate.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Spreadtrum gate clock driver
 //
diff --git a/drivers/clk/sprd/mux.h b/drivers/clk/sprd/mux.h
index 548cfa0f145c..892e4191cc7f 100644
--- a/drivers/clk/sprd/mux.h
+++ b/drivers/clk/sprd/mux.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Spreadtrum multiplexer clock driver
 //
diff --git a/drivers/clk/sprd/pll.h b/drivers/clk/sprd/pll.h
index 514175621099..e95f11e91ffe 100644
--- a/drivers/clk/sprd/pll.h
+++ b/drivers/clk/sprd/pll.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Spreadtrum pll clock driver
 //
-- 
2.17.1



[PATCH] clk: qcom: Use the correct style for SPDX License Identifier

2019-05-01 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in clk-regmap-mux-div.h. For C header files
Documentation/process/license-rules.rst mandates C-like
comments (opposed to C source files where C++ style
should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/clk/qcom/clk-regmap-mux-div.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/clk-regmap-mux-div.h 
b/drivers/clk/qcom/clk-regmap-mux-div.h
index 6cd6261be7ac..4df6c8d24c24 100644
--- a/drivers/clk/qcom/clk-regmap-mux-div.h
+++ b/drivers/clk/qcom/clk-regmap-mux-div.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2017, Linaro Limited
  * Author: Georgi Djakov 
-- 
2.17.1



[PATCH] clk: davinci: Use the correct style for SPDX License Identifier

2019-05-01 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Clock Drivers for Davinci Socs.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/clk/davinci/pll.h | 2 +-
 drivers/clk/davinci/psc.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/davinci/pll.h b/drivers/clk/davinci/pll.h
index 7cc354dd29e2..c2a453caa131 100644
--- a/drivers/clk/davinci/pll.h
+++ b/drivers/clk/davinci/pll.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Clock driver for TI Davinci PSC controllers
  *
diff --git a/drivers/clk/davinci/psc.h b/drivers/clk/davinci/psc.h
index cc5614567a70..69070f834391 100644
--- a/drivers/clk/davinci/psc.h
+++ b/drivers/clk/davinci/psc.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Clock driver for TI Davinci PSC controllers
  *
-- 
2.17.1



[PATCH] clk: actions: Use the correct style for SPDX License Identifier

2019-05-01 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in header files related to Clock Drivers for Actions Semi Socs.
For C header files Documentation/process/license-rules.rst
mandates C-like comments (opposed to C source files where
C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 drivers/clk/actions/owl-common.h   | 2 +-
 drivers/clk/actions/owl-composite.h| 2 +-
 drivers/clk/actions/owl-divider.h  | 2 +-
 drivers/clk/actions/owl-factor.h   | 2 +-
 drivers/clk/actions/owl-fixed-factor.h | 2 +-
 drivers/clk/actions/owl-gate.h | 2 +-
 drivers/clk/actions/owl-mux.h  | 2 +-
 drivers/clk/actions/owl-pll.h  | 2 +-
 drivers/clk/actions/owl-reset.h| 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/actions/owl-common.h b/drivers/clk/actions/owl-common.h
index 5a866a8b913d..c000a431471e 100644
--- a/drivers/clk/actions/owl-common.h
+++ b/drivers/clk/actions/owl-common.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL common clock driver
 //
diff --git a/drivers/clk/actions/owl-composite.h 
b/drivers/clk/actions/owl-composite.h
index b410ed5bf308..bca38bf8f218 100644
--- a/drivers/clk/actions/owl-composite.h
+++ b/drivers/clk/actions/owl-composite.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL composite clock driver
 //
diff --git a/drivers/clk/actions/owl-divider.h 
b/drivers/clk/actions/owl-divider.h
index 92d3e3d23967..083be6d80954 100644
--- a/drivers/clk/actions/owl-divider.h
+++ b/drivers/clk/actions/owl-divider.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL divider clock driver
 //
diff --git a/drivers/clk/actions/owl-factor.h b/drivers/clk/actions/owl-factor.h
index f1a7ffe896e1..04b89cbfdccb 100644
--- a/drivers/clk/actions/owl-factor.h
+++ b/drivers/clk/actions/owl-factor.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL factor clock driver
 //
diff --git a/drivers/clk/actions/owl-fixed-factor.h 
b/drivers/clk/actions/owl-fixed-factor.h
index cc9fe36c0964..3dfd7fd7d292 100644
--- a/drivers/clk/actions/owl-fixed-factor.h
+++ b/drivers/clk/actions/owl-fixed-factor.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL fixed factor clock driver
 //
diff --git a/drivers/clk/actions/owl-gate.h b/drivers/clk/actions/owl-gate.h
index c2d61ceebce2..c2f161c93fda 100644
--- a/drivers/clk/actions/owl-gate.h
+++ b/drivers/clk/actions/owl-gate.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL gate clock driver
 //
diff --git a/drivers/clk/actions/owl-mux.h b/drivers/clk/actions/owl-mux.h
index 834284c8c3ae..53b9ab665294 100644
--- a/drivers/clk/actions/owl-mux.h
+++ b/drivers/clk/actions/owl-mux.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL mux clock driver
 //
diff --git a/drivers/clk/actions/owl-pll.h b/drivers/clk/actions/owl-pll.h
index 6fb0d45bb088..78e5fc360b03 100644
--- a/drivers/clk/actions/owl-pll.h
+++ b/drivers/clk/actions/owl-pll.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 //
 // OWL pll clock driver
 //
diff --git a/drivers/clk/actions/owl-reset.h b/drivers/clk/actions/owl-reset.h
index 10f5774979a6..a947ffcb5a02 100644
--- a/drivers/clk/actions/owl-reset.h
+++ b/drivers/clk/actions/owl-reset.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 //
 // Actions Semi Owl SoCs Reset Management Unit driver
 //
-- 
2.17.1



Re: [PATCH v3 2/5] nds32: Use the correct style for SPDX License Identifier

2019-04-29 Thread Nishad Kamdar
On Tue, Apr 16, 2019 at 08:35:38PM +0200, Thomas Gleixner wrote:
> On Tue, 16 Apr 2019, Nishad Kamdar wrote:
> 
> > This patch corrects the SPDX License Identifier style
> > in the nds32 Hardware Architecture related files.
> > 
> > Suggested-by: Joe Perches 
> > Signed-off-by: Nishad Kamdar 
> 
> Actually instead of doing that we should fix the documentation. The
> requirement came from older binutils because they barfed on // style
> comments in ASM files. That's history as we upped the minimal binutil
> requirement.
> 
> Thanks,
> 
>   tglx

Ok.

So according to license-rules.rst,
which says

"This has been fixed by now, but there are still older assembler
tools which cannot handle C++ style comments."

Now there are no assembler tools which cannot handle C++ comments ?
and the document should be changed accordingly ?

Thanks for the review.

Regards,
Nishad




[PATCH v3 5/5] x86: Use the correct style for SPDX License Identifier

2019-04-16 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the x86 Hardware Architecture related files.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 arch/x86/include/asm/cpu_entry_area.h | 2 +-
 arch/x86/include/asm/pti.h| 2 +-
 arch/x86/kernel/process.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/cpu_entry_area.h 
b/arch/x86/include/asm/cpu_entry_area.h
index 29c706415443..84006ca0f17a 100644
--- a/arch/x86/include/asm/cpu_entry_area.h
+++ b/arch/x86/include/asm/cpu_entry_area.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 
 #ifndef _ASM_X86_CPU_ENTRY_AREA_H
 #define _ASM_X86_CPU_ENTRY_AREA_H
diff --git a/arch/x86/include/asm/pti.h b/arch/x86/include/asm/pti.h
index 5df09a0b80b8..07375b476c4f 100644
--- a/arch/x86/include/asm/pti.h
+++ b/arch/x86/include/asm/pti.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _ASM_X86_PTI_H
 #define _ASM_X86_PTI_H
 #ifndef __ASSEMBLY__
diff --git a/arch/x86/kernel/process.h b/arch/x86/kernel/process.h
index 320ab978fb1f..1d0797b2338a 100644
--- a/arch/x86/kernel/process.h
+++ b/arch/x86/kernel/process.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 //
 // Code shared between 32 and 64 bit
 
-- 
2.17.1



[PATCH v3 4/5] sh: Use the correct style for SPDX License Identifier

2019-04-16 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the SuperH Hardware Architecture related files.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 arch/sh/drivers/pci/pci-sh5.h | 4 ++--
 arch/sh/drivers/pci/pci-sh7751.h  | 4 ++--
 arch/sh/drivers/pci/pci-sh7780.h  | 4 ++--
 arch/sh/drivers/pci/pcie-sh7786.h | 4 ++--
 arch/sh/include/asm/addrspace.h   | 4 ++--
 arch/sh/include/asm/bl_bit_64.h   | 4 ++--
 arch/sh/include/asm/cache_insns_64.h  | 4 ++--
 arch/sh/include/asm/device.h  | 4 ++--
 arch/sh/include/asm/dma-register.h| 4 ++--
 arch/sh/include/asm/dma.h | 4 ++--
 arch/sh/include/asm/dwarf.h   | 4 ++--
 arch/sh/include/asm/fixmap.h  | 4 ++--
 arch/sh/include/asm/flat.h| 4 ++--
 arch/sh/include/asm/freq.h| 4 ++--
 arch/sh/include/asm/gpio.h| 4 ++--
 arch/sh/include/asm/machvec.h | 4 ++--
 arch/sh/include/asm/pgtable.h | 4 ++--
 arch/sh/include/asm/sfp-machine.h | 4 ++--
 arch/sh/include/asm/shmparam.h| 4 ++--
 arch/sh/include/asm/siu.h | 4 ++--
 arch/sh/include/asm/spinlock-cas.h| 4 ++--
 arch/sh/include/asm/spinlock-llsc.h   | 4 ++--
 arch/sh/include/asm/spinlock.h| 4 ++--
 arch/sh/include/asm/switch_to.h   | 4 ++--
 arch/sh/include/asm/switch_to_64.h| 4 ++--
 arch/sh/include/asm/tlb_64.h  | 4 ++--
 arch/sh/include/asm/traps_64.h| 4 ++--
 arch/sh/include/asm/watchdog.h| 4 ++--
 arch/sh/include/cpu-common/cpu/addrspace.h| 4 ++--
 arch/sh/include/cpu-common/cpu/mmu_context.h  | 4 ++--
 arch/sh/include/cpu-common/cpu/pfc.h  | 4 ++--
 arch/sh/include/cpu-sh2/cpu/cache.h   | 4 ++--
 arch/sh/include/cpu-sh2/cpu/freq.h| 4 ++--
 arch/sh/include/cpu-sh2/cpu/watchdog.h| 4 ++--
 arch/sh/include/cpu-sh2a/cpu/cache.h  | 4 ++--
 arch/sh/include/cpu-sh2a/cpu/freq.h   | 4 ++--
 arch/sh/include/cpu-sh3/cpu/cache.h   | 4 ++--
 arch/sh/include/cpu-sh3/cpu/dma-register.h| 4 ++--
 arch/sh/include/cpu-sh3/cpu/freq.h| 4 ++--
 arch/sh/include/cpu-sh3/cpu/gpio.h| 4 ++--
 arch/sh/include/cpu-sh3/cpu/mmu_context.h | 4 ++--
 arch/sh/include/cpu-sh3/cpu/watchdog.h| 4 ++--
 arch/sh/include/cpu-sh4/cpu/addrspace.h   | 4 ++--
 arch/sh/include/cpu-sh4/cpu/cache.h   | 4 ++--
 arch/sh/include/cpu-sh4/cpu/dma-register.h| 4 ++--
 arch/sh/include/cpu-sh4/cpu/fpu.h | 4 ++--
 arch/sh/include/cpu-sh4/cpu/freq.h| 4 ++--
 arch/sh/include/cpu-sh4/cpu/mmu_context.h | 4 ++--
 arch/sh/include/cpu-sh4/cpu/sh7786.h  | 4 ++--
 arch/sh/include/cpu-sh4/cpu/sq.h  | 4 ++--
 arch/sh/include/cpu-sh4/cpu/watchdog.h| 4 ++--
 arch/sh/include/mach-common/mach/hp6xx.h  | 4 ++--
 arch/sh/include/mach-common/mach/magicpanelr2.h   | 4 ++--
 arch/sh/include/mach-common/mach/mangle-port.h| 4 ++--
 arch/sh/include/mach-common/mach/microdev.h   | 4 ++--
 arch/sh/include/mach-common/mach/secureedge5410.h | 4 ++--
 arch/sh/include/mach-dreamcast/mach/dma.h | 4 ++--
 arch/sh/include/mach-dreamcast/mach/pci.h | 4 ++--
 arch/sh/include/mach-dreamcast/mach/sysasic.h | 4 ++--
 arch/sh/include/mach-se/mach/se7721.h | 4 ++--
 60 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/arch/sh/drivers/pci/pci-sh5.h b/arch/sh/drivers/pci/pci-sh5.h
index 91348af0ef6c..0d2c093fd984 100644
--- a/arch/sh/drivers/pci/pci-sh5.h
+++ b/arch/sh/drivers/pci/pci-sh5.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
  * Copyright (C) 2001 David J. Mckay (david.mc...@st.com)
  *
  * Definitions for the SH5 PCI hardware.
diff --git a/arch/sh/drivers/pci/pci-sh7751.h b/arch/sh/drivers/pci/pci-sh7751.h
index d1951e50effc..9e23cf7113ac 100644
--- a/arch/sh/drivers/pci/pci-sh7751.h
+++ b/arch/sh/drivers/pci/pci-sh7751.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
  * Low-Level PCI Support for SH7751 targets
  *
  *  Dustin McIntire (dus...@sensoria.com) (c) 2001
diff --git a/arch/sh/drivers/pci/pci-sh7780.h b/arch/sh/drivers/pci/pci-sh7780.h
index e2ac770f8e35..7ba87b62e439 100644
--- a/arch/sh/drivers/pci/pci-sh7780.h
+++ b/arch/sh/drivers/pci/pci-sh7780.h
@@ -1,5 +1,5 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
  * Low-Level PCI Support for SH7780 targets
  *
  *  Dustin McIntire

[PATCH v3 2/5] nds32: Use the correct style for SPDX License Identifier

2019-04-16 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the nds32 Hardware Architecture related files.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 arch/nds32/include/asm/assembler.h   | 2 +-
 arch/nds32/include/asm/barrier.h | 2 +-
 arch/nds32/include/asm/bitfield.h| 2 +-
 arch/nds32/include/asm/cache.h   | 2 +-
 arch/nds32/include/asm/cache_info.h  | 2 +-
 arch/nds32/include/asm/cacheflush.h  | 2 +-
 arch/nds32/include/asm/current.h | 2 +-
 arch/nds32/include/asm/delay.h   | 2 +-
 arch/nds32/include/asm/elf.h | 2 +-
 arch/nds32/include/asm/fixmap.h  | 2 +-
 arch/nds32/include/asm/futex.h   | 2 +-
 arch/nds32/include/asm/highmem.h | 2 +-
 arch/nds32/include/asm/io.h  | 2 +-
 arch/nds32/include/asm/irqflags.h| 2 +-
 arch/nds32/include/asm/l2_cache.h| 2 +-
 arch/nds32/include/asm/linkage.h | 2 +-
 arch/nds32/include/asm/memory.h  | 2 +-
 arch/nds32/include/asm/mmu.h | 2 +-
 arch/nds32/include/asm/mmu_context.h | 2 +-
 arch/nds32/include/asm/module.h  | 2 +-
 arch/nds32/include/asm/nds32.h   | 2 +-
 arch/nds32/include/asm/page.h| 2 +-
 arch/nds32/include/asm/pgalloc.h | 2 +-
 arch/nds32/include/asm/pgtable.h | 2 +-
 arch/nds32/include/asm/proc-fns.h| 2 +-
 arch/nds32/include/asm/processor.h   | 2 +-
 arch/nds32/include/asm/ptrace.h  | 2 +-
 arch/nds32/include/asm/shmparam.h| 2 +-
 arch/nds32/include/asm/string.h  | 2 +-
 arch/nds32/include/asm/swab.h| 2 +-
 arch/nds32/include/asm/syscall.h | 2 +-
 arch/nds32/include/asm/syscalls.h| 2 +-
 arch/nds32/include/asm/thread_info.h | 2 +-
 arch/nds32/include/asm/tlb.h | 2 +-
 arch/nds32/include/asm/tlbflush.h| 2 +-
 arch/nds32/include/asm/uaccess.h | 2 +-
 arch/nds32/include/asm/unistd.h  | 2 +-
 arch/nds32/include/asm/vdso.h| 2 +-
 arch/nds32/include/asm/vdso_datapage.h   | 2 +-
 arch/nds32/include/asm/vdso_timer_info.h | 2 +-
 arch/nds32/include/uapi/asm/auxvec.h | 2 +-
 arch/nds32/include/uapi/asm/byteorder.h  | 2 +-
 arch/nds32/include/uapi/asm/cachectl.h   | 2 +-
 arch/nds32/include/uapi/asm/param.h  | 2 +-
 arch/nds32/include/uapi/asm/ptrace.h | 2 +-
 arch/nds32/include/uapi/asm/sigcontext.h | 2 +-
 arch/nds32/include/uapi/asm/unistd.h | 2 +-
 47 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/arch/nds32/include/asm/assembler.h 
b/arch/nds32/include/asm/assembler.h
index c3855782a541..5e7c56926049 100644
--- a/arch/nds32/include/asm/assembler.h
+++ b/arch/nds32/include/asm/assembler.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2005-2017 Andes Technology Corporation
 
 #ifndef __NDS32_ASSEMBLER_H__
diff --git a/arch/nds32/include/asm/barrier.h b/arch/nds32/include/asm/barrier.h
index faafc373ea6c..16413172fd50 100644
--- a/arch/nds32/include/asm/barrier.h
+++ b/arch/nds32/include/asm/barrier.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2005-2017 Andes Technology Corporation
 
 #ifndef __NDS32_ASM_BARRIER_H
diff --git a/arch/nds32/include/asm/bitfield.h 
b/arch/nds32/include/asm/bitfield.h
index 7414fcbbab4e..e75212c76b20 100644
--- a/arch/nds32/include/asm/bitfield.h
+++ b/arch/nds32/include/asm/bitfield.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2005-2017 Andes Technology Corporation
 
 #ifndef __NDS32_BITFIELD_H__
diff --git a/arch/nds32/include/asm/cache.h b/arch/nds32/include/asm/cache.h
index 347db4881c5f..fc3c41b59169 100644
--- a/arch/nds32/include/asm/cache.h
+++ b/arch/nds32/include/asm/cache.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2005-2017 Andes Technology Corporation
 
 #ifndef __NDS32_CACHE_H__
diff --git a/arch/nds32/include/asm/cache_info.h 
b/arch/nds32/include/asm/cache_info.h
index 38ec458ba543..e89d8078f3a6 100644
--- a/arch/nds32/include/asm/cache_info.h
+++ b/arch/nds32/include/asm/cache_info.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2005-2017 Andes Technology Corporation
 
 struct cache_info {
diff --git a/arch/nds32/include/asm/cacheflush.h 
b/arch/nds32/include/asm/cacheflush.h
index 8b26198d51bb..d9ac7e6408ef 100644
--- a/arch/nds32/include/asm/cacheflush.h
+++ b/arch/nds32/include/asm/cacheflush.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2005-2017 Andes Technology Corporation
 
 #ifndef __NDS32_CACHEFLUSH_H__
diff --git a/arch/nds32/include/asm/current.h b/arch/nds32/include/asm/current.h
index b4dcd22b7bcb..65d30096142b 100644
--- a/arch/nds32/include/asm/current.h
+++ b

[PATCH v3 1/5] arm64: Use the correct style for SPDX License Identifier

2019-04-16 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the arm64 Hardware Architecture related files.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 2 +-
 arch/arm64/include/asm/pointer_auth.h | 2 +-
 arch/arm64/include/asm/sdei.h | 2 +-
 arch/arm64/include/asm/vmap_stack.h   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h 
b/arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h
index 1b4cb0c55744..385c455a7c98 100644
--- a/arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h
+++ b/arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2018 MediaTek Inc.
  * Author: Zhiyong Tao 
diff --git a/arch/arm64/include/asm/pointer_auth.h 
b/arch/arm64/include/asm/pointer_auth.h
index 15d49515efdd..d328540cb85e 100644
--- a/arch/arm64/include/asm/pointer_auth.h
+++ b/arch/arm64/include/asm/pointer_auth.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef __ASM_POINTER_AUTH_H
 #define __ASM_POINTER_AUTH_H
 
diff --git a/arch/arm64/include/asm/sdei.h b/arch/arm64/include/asm/sdei.h
index ffe47d766c25..63e0b92a5fbb 100644
--- a/arch/arm64/include/asm/sdei.h
+++ b/arch/arm64/include/asm/sdei.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2017 Arm Ltd.
 #ifndef __ASM_SDEI_H
 #define __ASM_SDEI_H
diff --git a/arch/arm64/include/asm/vmap_stack.h 
b/arch/arm64/include/asm/vmap_stack.h
index 0b5ec6e08c10..0a12115d9638 100644
--- a/arch/arm64/include/asm/vmap_stack.h
+++ b/arch/arm64/include/asm/vmap_stack.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 // Copyright (C) 2017 Arm Ltd.
 #ifndef __ASM_VMAP_STACK_H
 #define __ASM_VMAP_STACK_H
-- 
2.17.1



[PATCH v3 0/5] ARCH: Use the correct style for SPDX License Identifier

2019-04-16 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the Hardware Architecture subsystem. For C header files
Documentation/process/license-rules.rst mandates C-like comments
(opposed to C source files where C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46
and making some manual changes.

Changes in v3:
 - Split the patch by architecture so that the repective maintainers
   can pick it up.
Changes in v2:
 - Added a note in the patch description.

Nishad Kamdar (5):
  arm64: Use the correct style for SPDX License Identifier
  nds32: Use the correct style for SPDX License Identifier
  powerpc: Use the correct style for SPDX License Identifier
  sh: Use the correct style for SPDX License Identifier
  x86: Use the correct style for SPDX License Identifier

 arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 2 +-
 arch/arm64/include/asm/pointer_auth.h | 2 +-
 arch/arm64/include/asm/sdei.h | 2 +-
 arch/arm64/include/asm/vmap_stack.h   | 2 +-
 arch/nds32/include/asm/assembler.h| 2 +-
 arch/nds32/include/asm/barrier.h  | 2 +-
 arch/nds32/include/asm/bitfield.h | 2 +-
 arch/nds32/include/asm/cache.h| 2 +-
 arch/nds32/include/asm/cache_info.h   | 2 +-
 arch/nds32/include/asm/cacheflush.h   | 2 +-
 arch/nds32/include/asm/current.h  | 2 +-
 arch/nds32/include/asm/delay.h| 2 +-
 arch/nds32/include/asm/elf.h  | 2 +-
 arch/nds32/include/asm/fixmap.h   | 2 +-
 arch/nds32/include/asm/futex.h| 2 +-
 arch/nds32/include/asm/highmem.h  | 2 +-
 arch/nds32/include/asm/io.h   | 2 +-
 arch/nds32/include/asm/irqflags.h | 2 +-
 arch/nds32/include/asm/l2_cache.h | 2 +-
 arch/nds32/include/asm/linkage.h  | 2 +-
 arch/nds32/include/asm/memory.h   | 2 +-
 arch/nds32/include/asm/mmu.h  | 2 +-
 arch/nds32/include/asm/mmu_context.h  | 2 +-
 arch/nds32/include/asm/module.h   | 2 +-
 arch/nds32/include/asm/nds32.h| 2 +-
 arch/nds32/include/asm/page.h | 2 +-
 arch/nds32/include/asm/pgalloc.h  | 2 +-
 arch/nds32/include/asm/pgtable.h  | 2 +-
 arch/nds32/include/asm/proc-fns.h | 2 +-
 arch/nds32/include/asm/processor.h| 2 +-
 arch/nds32/include/asm/ptrace.h   | 2 +-
 arch/nds32/include/asm/shmparam.h | 2 +-
 arch/nds32/include/asm/string.h   | 2 +-
 arch/nds32/include/asm/swab.h | 2 +-
 arch/nds32/include/asm/syscall.h  | 2 +-
 arch/nds32/include/asm/syscalls.h | 2 +-
 arch/nds32/include/asm/thread_info.h  | 2 +-
 arch/nds32/include/asm/tlb.h  | 2 +-
 arch/nds32/include/asm/tlbflush.h | 2 +-
 arch/nds32/include/asm/uaccess.h  | 2 +-
 arch/nds32/include/asm/unistd.h   | 2 +-
 arch/nds32/include/asm/vdso.h | 2 +-
 arch/nds32/include/asm/vdso_datapage.h| 2 +-
 arch/nds32/include/asm/vdso_timer_info.h  | 2 +-
 arch/nds32/include/uapi/asm/auxvec.h  | 2 +-
 arch/nds32/include/uapi/asm/byteorder.h   | 2 +-
 arch/nds32/include/uapi/asm/cachectl.h| 2 +-
 arch/nds32/include/uapi/asm/param.h   | 2 +-
 arch/nds32/include/uapi/asm/ptrace.h  | 2 +-
 arch/nds32/include/uapi/asm/sigcontext.h  | 2 +-
 arch/nds32/include/uapi/asm/unistd.h  | 2 +-
 arch/powerpc/include/asm/pnv-ocxl.h   | 2 +-
 arch/sh/drivers/pci/pci-sh5.h | 4 ++--
 arch/sh/drivers/pci/pci-sh7751.h  | 4 ++--
 arch/sh/drivers/pci/pci-sh7780.h  | 4 ++--
 arch/sh/drivers/pci/pcie-sh7786.h | 4 ++--
 arch/sh/include/asm/addrspace.h   | 4 ++--
 arch/sh/include/asm/bl_bit_64.h   | 4 ++--
 arch/sh/include/asm/cache_insns_64.h  | 4 ++--
 arch/sh/include/asm/device.h  | 4 ++--
 arch/sh/include/asm/dma-register.h| 4 ++--
 arch/sh/include/asm/dma.h | 4 ++--
 arch/sh/include/asm/dwarf.h   | 4 ++--
 arch/sh/include/asm/fixmap.h  | 4 ++--
 arch/sh/include/asm/flat.h| 4 ++--
 arch/sh/include/asm/freq.h| 4 ++--
 arch/sh/include/asm/gpio.h| 4 ++--
 arch/sh/include/asm/machvec.h | 4 ++--
 arch/sh/include/asm/pgtable.h | 4 ++--
 arch/sh/include/asm/sfp-machine.h | 4 ++--
 arch/sh/include/asm/shmparam.h| 4

Re: [PATCH v2] ARCH: Use the correct style for SPDX License Identifier

2019-04-08 Thread Nishad Kamdar
On Sun, Mar 31, 2019 at 06:14:01PM +0530, Mukesh Ojha wrote:
> 
> On 3/31/2019 3:51 AM, Nishad Kamdar wrote:
> > This patch corrects the SPDX License Identifier style
> > in the Hardware Architecture subsystem. For C header files
> > Documentation/process/license-rules.rst mandates C-like comments
> > (opposed to C source files where C++ style should be used)
> > 
> > Changes made by using a script provided by Joe Perches here:
> > https://lkml.org/lkml/2019/2/7/46
> > and making some manual changes.
> > 
> > Suggested-by: Joe Perches 
> > Signed-off-by: Nishad Kamdar 
> > ---
> Add change log here.
> >   arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 2 +-
> >   arch/arm64/include/asm/pointer_auth.h | 2 +-
> >   arch/arm64/include/asm/sdei.h | 2 +-
> >   arch/arm64/include/asm/vmap_stack.h   | 2 +-
> 
> 
> I agree with Rob in this  to split these patches into arch basis and change
> the subject accordingly.
> 
> Please do that.
>
Ok, I'll do that.

Thanks for the review.

Thanks and regards,
Nishad
> 
> Cheers.
> Mukesh
> 
> >   arch/nds32/include/asm/assembler.h| 2 +-
> >   arch/nds32/include/asm/barrier.h  | 2 +-
> >   arch/nds32/include/asm/bitfield.h | 2 +-
> >   arch/nds32/include/asm/cache.h| 2 +-
> >   arch/nds32/include/asm/cache_info.h   | 2 +-
> >   arch/nds32/include/asm/cacheflush.h   | 2 +-
> >   arch/nds32/include/asm/current.h  | 2 +-
> >   arch/nds32/include/asm/delay.h| 2 +-
> >   arch/nds32/include/asm/elf.h  | 2 +-
> >   arch/nds32/include/asm/fixmap.h   | 2 +-
> >   arch/nds32/include/asm/futex.h| 2 +-
> >   arch/nds32/include/asm/highmem.h  | 2 +-
> >   arch/nds32/include/asm/io.h   | 2 +-
> >   arch/nds32/include/asm/irqflags.h | 2 +-
> >   arch/nds32/include/asm/l2_cache.h | 2 +-
> >   arch/nds32/include/asm/linkage.h  | 2 +-
> >   arch/nds32/include/asm/memory.h   | 2 +-
> >   arch/nds32/include/asm/mmu.h  | 2 +-
> >   arch/nds32/include/asm/mmu_context.h  | 2 +-
> >   arch/nds32/include/asm/module.h   | 2 +-
> >   arch/nds32/include/asm/nds32.h| 2 +-
> >   arch/nds32/include/asm/page.h | 2 +-
> >   arch/nds32/include/asm/pgalloc.h  | 2 +-
> >   arch/nds32/include/asm/pgtable.h  | 2 +-
> >   arch/nds32/include/asm/proc-fns.h | 2 +-
> >   arch/nds32/include/asm/processor.h| 2 +-
> >   arch/nds32/include/asm/ptrace.h   | 2 +-
> >   arch/nds32/include/asm/shmparam.h | 2 +-
> >   arch/nds32/include/asm/string.h   | 2 +-
> >   arch/nds32/include/asm/swab.h | 2 +-
> >   arch/nds32/include/asm/syscall.h  | 2 +-
> >   arch/nds32/include/asm/syscalls.h | 2 +-
> >   arch/nds32/include/asm/thread_info.h  | 2 +-
> >   arch/nds32/include/asm/tlb.h  | 2 +-
> >   arch/nds32/include/asm/tlbflush.h | 2 +-
> >   arch/nds32/include/asm/uaccess.h  | 2 +-
> >   arch/nds32/include/asm/unistd.h   | 2 +-
> >   arch/nds32/include/asm/vdso.h | 2 +-
> >   arch/nds32/include/asm/vdso_datapage.h| 2 +-
> >   arch/nds32/include/asm/vdso_timer_info.h  | 2 +-
> >   arch/nds32/include/uapi/asm/auxvec.h  | 2 +-
> >   arch/nds32/include/uapi/asm/byteorder.h   | 2 +-
> >   arch/nds32/include/uapi/asm/cachectl.h| 2 +-
> >   arch/nds32/include/uapi/asm/param.h   | 2 +-
> >   arch/nds32/include/uapi/asm/ptrace.h  | 2 +-
> >   arch/nds32/include/uapi/asm/sigcontext.h  | 2 +-
> >   arch/nds32/include/uapi/asm/unistd.h  | 2 +-
> >   arch/powerpc/include/asm/pnv-ocxl.h   | 2 +-
> >   arch/sh/drivers/pci/pci-sh5.h | 4 ++--
> >   arch/sh/drivers/pci/pci-sh7751.h  | 4 ++--
> >   arch/sh/drivers/pci/pci-sh7780.h  | 4 ++--
> >   arch/sh/drivers/pci/pcie-sh7786.h | 4 ++--
> >   arch/sh/include/asm/addrspace.h   | 4 ++--
> >   arch/sh/include/asm/bl_bit_64.h   | 4 ++--
> >   arch/sh/inclu

Re: [PATCH] ARCH: Use the correct style for SPDX License Identifier

2019-04-08 Thread Nishad Kamdar
On Sun, Mar 31, 2019 at 01:41:26AM -0500, Rob Herring wrote:
> On Sat, Mar 23, 2019 at 06:58:14PM +0530, Nishad Kamdar wrote:
> > This patch corrects the SPDX License Identifier style
> > in the Hardware Architecture subsystem.
> > 
> > Changes made by using a script provided by Joe Perches here:
> > https://lkml.org/lkml/2019/2/7/46
> > and making some manual changes.
> > 
> > Suggested-by: Joe Perches 
> > Signed-off-by: Nishad Kamdar 
> > ---
> >  arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 2 +-
> >  arch/arm64/include/asm/pointer_auth.h | 2 +-
> >  arch/arm64/include/asm/sdei.h | 2 +-
> >  arch/arm64/include/asm/vmap_stack.h   | 2 +-
> >  arch/nds32/include/asm/assembler.h| 2 +-
> 
> No reason to put all arches in one patch. Please split by arch for 
> maintainers to take.
> 
> Rob
> 
Ok, I'll do that.

Thanks for the review.

Thanks and regards,
Nishad


[PATCH v2] ARCH: Use the correct style for SPDX License Identifier

2019-03-30 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the Hardware Architecture subsystem. For C header files
Documentation/process/license-rules.rst mandates C-like comments
(opposed to C source files where C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46
and making some manual changes.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Added a note in the patch description.
---
 arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 2 +-
 arch/arm64/include/asm/pointer_auth.h | 2 +-
 arch/arm64/include/asm/sdei.h | 2 +-
 arch/arm64/include/asm/vmap_stack.h   | 2 +-
 arch/nds32/include/asm/assembler.h| 2 +-
 arch/nds32/include/asm/barrier.h  | 2 +-
 arch/nds32/include/asm/bitfield.h | 2 +-
 arch/nds32/include/asm/cache.h| 2 +-
 arch/nds32/include/asm/cache_info.h   | 2 +-
 arch/nds32/include/asm/cacheflush.h   | 2 +-
 arch/nds32/include/asm/current.h  | 2 +-
 arch/nds32/include/asm/delay.h| 2 +-
 arch/nds32/include/asm/elf.h  | 2 +-
 arch/nds32/include/asm/fixmap.h   | 2 +-
 arch/nds32/include/asm/futex.h| 2 +-
 arch/nds32/include/asm/highmem.h  | 2 +-
 arch/nds32/include/asm/io.h   | 2 +-
 arch/nds32/include/asm/irqflags.h | 2 +-
 arch/nds32/include/asm/l2_cache.h | 2 +-
 arch/nds32/include/asm/linkage.h  | 2 +-
 arch/nds32/include/asm/memory.h   | 2 +-
 arch/nds32/include/asm/mmu.h  | 2 +-
 arch/nds32/include/asm/mmu_context.h  | 2 +-
 arch/nds32/include/asm/module.h   | 2 +-
 arch/nds32/include/asm/nds32.h| 2 +-
 arch/nds32/include/asm/page.h | 2 +-
 arch/nds32/include/asm/pgalloc.h  | 2 +-
 arch/nds32/include/asm/pgtable.h  | 2 +-
 arch/nds32/include/asm/proc-fns.h | 2 +-
 arch/nds32/include/asm/processor.h| 2 +-
 arch/nds32/include/asm/ptrace.h   | 2 +-
 arch/nds32/include/asm/shmparam.h | 2 +-
 arch/nds32/include/asm/string.h   | 2 +-
 arch/nds32/include/asm/swab.h | 2 +-
 arch/nds32/include/asm/syscall.h  | 2 +-
 arch/nds32/include/asm/syscalls.h | 2 +-
 arch/nds32/include/asm/thread_info.h  | 2 +-
 arch/nds32/include/asm/tlb.h  | 2 +-
 arch/nds32/include/asm/tlbflush.h | 2 +-
 arch/nds32/include/asm/uaccess.h  | 2 +-
 arch/nds32/include/asm/unistd.h   | 2 +-
 arch/nds32/include/asm/vdso.h | 2 +-
 arch/nds32/include/asm/vdso_datapage.h| 2 +-
 arch/nds32/include/asm/vdso_timer_info.h  | 2 +-
 arch/nds32/include/uapi/asm/auxvec.h  | 2 +-
 arch/nds32/include/uapi/asm/byteorder.h   | 2 +-
 arch/nds32/include/uapi/asm/cachectl.h| 2 +-
 arch/nds32/include/uapi/asm/param.h   | 2 +-
 arch/nds32/include/uapi/asm/ptrace.h  | 2 +-
 arch/nds32/include/uapi/asm/sigcontext.h  | 2 +-
 arch/nds32/include/uapi/asm/unistd.h  | 2 +-
 arch/powerpc/include/asm/pnv-ocxl.h   | 2 +-
 arch/sh/drivers/pci/pci-sh5.h | 4 ++--
 arch/sh/drivers/pci/pci-sh7751.h  | 4 ++--
 arch/sh/drivers/pci/pci-sh7780.h  | 4 ++--
 arch/sh/drivers/pci/pcie-sh7786.h | 4 ++--
 arch/sh/include/asm/addrspace.h   | 4 ++--
 arch/sh/include/asm/bl_bit_64.h   | 4 ++--
 arch/sh/include/asm/cache_insns_64.h  | 4 ++--
 arch/sh/include/asm/device.h  | 4 ++--
 arch/sh/include/asm/dma-register.h| 4 ++--
 arch/sh/include/asm/dma.h | 4 ++--
 arch/sh/include/asm/dwarf.h   | 4 ++--
 arch/sh/include/asm/fixmap.h  | 4 ++--
 arch/sh/include/asm/flat.h| 4 ++--
 arch/sh/include/asm/freq.h| 4 ++--
 arch/sh/include/asm/gpio.h| 4 ++--
 arch/sh/include/asm/machvec.h | 4 ++--
 arch/sh/include/asm/pgtable.h | 4 ++--
 arch/sh/include/asm/sfp-machine.h | 4 ++--
 arch/sh/include/asm/shmparam.h| 4 ++--
 arch/sh/include/asm/siu.h | 4 ++--
 arch/sh/include/asm/spinlock-cas.h| 4 ++--
 arch/sh/include/asm/spinlock-llsc.h   | 4 ++--
 arch/sh/include/asm/spinlock.h| 4 ++--
 arch/sh/include/asm/switch_to.h   | 4 ++--
 arch/sh/include/asm/switch_to_64.h| 4

[PATCH v2] ARCH: Use the correct style for SPDX License Identifier

2019-03-30 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the Hardware Architecture subsystem. For C header files
Documentation/process/license-rules.rst mandates C-like comments
(opposed to C source files where C++ style should be used)

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46
and making some manual changes.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 2 +-
 arch/arm64/include/asm/pointer_auth.h | 2 +-
 arch/arm64/include/asm/sdei.h | 2 +-
 arch/arm64/include/asm/vmap_stack.h   | 2 +-
 arch/nds32/include/asm/assembler.h| 2 +-
 arch/nds32/include/asm/barrier.h  | 2 +-
 arch/nds32/include/asm/bitfield.h | 2 +-
 arch/nds32/include/asm/cache.h| 2 +-
 arch/nds32/include/asm/cache_info.h   | 2 +-
 arch/nds32/include/asm/cacheflush.h   | 2 +-
 arch/nds32/include/asm/current.h  | 2 +-
 arch/nds32/include/asm/delay.h| 2 +-
 arch/nds32/include/asm/elf.h  | 2 +-
 arch/nds32/include/asm/fixmap.h   | 2 +-
 arch/nds32/include/asm/futex.h| 2 +-
 arch/nds32/include/asm/highmem.h  | 2 +-
 arch/nds32/include/asm/io.h   | 2 +-
 arch/nds32/include/asm/irqflags.h | 2 +-
 arch/nds32/include/asm/l2_cache.h | 2 +-
 arch/nds32/include/asm/linkage.h  | 2 +-
 arch/nds32/include/asm/memory.h   | 2 +-
 arch/nds32/include/asm/mmu.h  | 2 +-
 arch/nds32/include/asm/mmu_context.h  | 2 +-
 arch/nds32/include/asm/module.h   | 2 +-
 arch/nds32/include/asm/nds32.h| 2 +-
 arch/nds32/include/asm/page.h | 2 +-
 arch/nds32/include/asm/pgalloc.h  | 2 +-
 arch/nds32/include/asm/pgtable.h  | 2 +-
 arch/nds32/include/asm/proc-fns.h | 2 +-
 arch/nds32/include/asm/processor.h| 2 +-
 arch/nds32/include/asm/ptrace.h   | 2 +-
 arch/nds32/include/asm/shmparam.h | 2 +-
 arch/nds32/include/asm/string.h   | 2 +-
 arch/nds32/include/asm/swab.h | 2 +-
 arch/nds32/include/asm/syscall.h  | 2 +-
 arch/nds32/include/asm/syscalls.h | 2 +-
 arch/nds32/include/asm/thread_info.h  | 2 +-
 arch/nds32/include/asm/tlb.h  | 2 +-
 arch/nds32/include/asm/tlbflush.h | 2 +-
 arch/nds32/include/asm/uaccess.h  | 2 +-
 arch/nds32/include/asm/unistd.h   | 2 +-
 arch/nds32/include/asm/vdso.h | 2 +-
 arch/nds32/include/asm/vdso_datapage.h| 2 +-
 arch/nds32/include/asm/vdso_timer_info.h  | 2 +-
 arch/nds32/include/uapi/asm/auxvec.h  | 2 +-
 arch/nds32/include/uapi/asm/byteorder.h   | 2 +-
 arch/nds32/include/uapi/asm/cachectl.h| 2 +-
 arch/nds32/include/uapi/asm/param.h   | 2 +-
 arch/nds32/include/uapi/asm/ptrace.h  | 2 +-
 arch/nds32/include/uapi/asm/sigcontext.h  | 2 +-
 arch/nds32/include/uapi/asm/unistd.h  | 2 +-
 arch/powerpc/include/asm/pnv-ocxl.h   | 2 +-
 arch/sh/drivers/pci/pci-sh5.h | 4 ++--
 arch/sh/drivers/pci/pci-sh7751.h  | 4 ++--
 arch/sh/drivers/pci/pci-sh7780.h  | 4 ++--
 arch/sh/drivers/pci/pcie-sh7786.h | 4 ++--
 arch/sh/include/asm/addrspace.h   | 4 ++--
 arch/sh/include/asm/bl_bit_64.h   | 4 ++--
 arch/sh/include/asm/cache_insns_64.h  | 4 ++--
 arch/sh/include/asm/device.h  | 4 ++--
 arch/sh/include/asm/dma-register.h| 4 ++--
 arch/sh/include/asm/dma.h | 4 ++--
 arch/sh/include/asm/dwarf.h   | 4 ++--
 arch/sh/include/asm/fixmap.h  | 4 ++--
 arch/sh/include/asm/flat.h| 4 ++--
 arch/sh/include/asm/freq.h| 4 ++--
 arch/sh/include/asm/gpio.h| 4 ++--
 arch/sh/include/asm/machvec.h | 4 ++--
 arch/sh/include/asm/pgtable.h | 4 ++--
 arch/sh/include/asm/sfp-machine.h | 4 ++--
 arch/sh/include/asm/shmparam.h| 4 ++--
 arch/sh/include/asm/siu.h | 4 ++--
 arch/sh/include/asm/spinlock-cas.h| 4 ++--
 arch/sh/include/asm/spinlock-llsc.h   | 4 ++--
 arch/sh/include/asm/spinlock.h| 4 ++--
 arch/sh/include/asm/switch_to.h   | 4 ++--
 arch/sh/include/asm/switch_to_64.h| 4 ++--
 arch/sh/include/asm/tlb_64.h  | 4

Re: [PATCH] ARCH: Use the correct style for SPDX License Identifier

2019-03-30 Thread Nishad Kamdar
On Sat, Mar 23, 2019 at 09:59:37PM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> On Sat, Mar 23, 2019 at 06:58:14PM +0530, Nishad Kamdar wrote:
> > This patch corrects the SPDX License Identifier style
> > in the Hardware Architecture subsystem.
> > 
> > Changes made by using a script provided by Joe Perches here:
> > https://lkml.org/lkml/2019/2/7/46
> > and making some manual changes.
> 
> Adding a note here that for C header files
> Documentation/process/license-rules.rst mandates C-like comments
> (opposed to C source files where C++ style should be used) would be a
> good idea I think.
> 
> Best regards
> Uwe
> 
> -- 
> Pengutronix e.K.   | Uwe Kleine-König|
> Industrial Linux Solutions | http://www.pengutronix.de/  |

Sorry for the late reply.

Ok, I'll do that.

Thanks for the review.

Thanks and regards,
Nishad


[PATCH] ARCH: Use the correct style for SPDX License Identifier

2019-03-23 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in the Hardware Architecture subsystem.

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46
and making some manual changes.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 arch/arm64/boot/dts/mediatek/mt2712-pinfunc.h | 2 +-
 arch/arm64/include/asm/pointer_auth.h | 2 +-
 arch/arm64/include/asm/sdei.h | 2 +-
 arch/arm64/include/asm/vmap_stack.h   | 2 +-
 arch/nds32/include/asm/assembler.h| 2 +-
 arch/nds32/include/asm/barrier.h  | 2 +-
 arch/nds32/include/asm/bitfield.h | 2 +-
 arch/nds32/include/asm/cache.h| 2 +-
 arch/nds32/include/asm/cache_info.h   | 2 +-
 arch/nds32/include/asm/cacheflush.h   | 2 +-
 arch/nds32/include/asm/current.h  | 2 +-
 arch/nds32/include/asm/delay.h| 2 +-
 arch/nds32/include/asm/elf.h  | 2 +-
 arch/nds32/include/asm/fixmap.h   | 2 +-
 arch/nds32/include/asm/futex.h| 2 +-
 arch/nds32/include/asm/highmem.h  | 2 +-
 arch/nds32/include/asm/io.h   | 2 +-
 arch/nds32/include/asm/irqflags.h | 2 +-
 arch/nds32/include/asm/l2_cache.h | 2 +-
 arch/nds32/include/asm/linkage.h  | 2 +-
 arch/nds32/include/asm/memory.h   | 2 +-
 arch/nds32/include/asm/mmu.h  | 2 +-
 arch/nds32/include/asm/mmu_context.h  | 2 +-
 arch/nds32/include/asm/module.h   | 2 +-
 arch/nds32/include/asm/nds32.h| 2 +-
 arch/nds32/include/asm/page.h | 2 +-
 arch/nds32/include/asm/pgalloc.h  | 2 +-
 arch/nds32/include/asm/pgtable.h  | 2 +-
 arch/nds32/include/asm/proc-fns.h | 2 +-
 arch/nds32/include/asm/processor.h| 2 +-
 arch/nds32/include/asm/ptrace.h   | 2 +-
 arch/nds32/include/asm/shmparam.h | 2 +-
 arch/nds32/include/asm/string.h   | 2 +-
 arch/nds32/include/asm/swab.h | 2 +-
 arch/nds32/include/asm/syscall.h  | 2 +-
 arch/nds32/include/asm/syscalls.h | 2 +-
 arch/nds32/include/asm/thread_info.h  | 2 +-
 arch/nds32/include/asm/tlb.h  | 2 +-
 arch/nds32/include/asm/tlbflush.h | 2 +-
 arch/nds32/include/asm/uaccess.h  | 2 +-
 arch/nds32/include/asm/unistd.h   | 2 +-
 arch/nds32/include/asm/vdso.h | 2 +-
 arch/nds32/include/asm/vdso_datapage.h| 2 +-
 arch/nds32/include/asm/vdso_timer_info.h  | 2 +-
 arch/nds32/include/uapi/asm/auxvec.h  | 2 +-
 arch/nds32/include/uapi/asm/byteorder.h   | 2 +-
 arch/nds32/include/uapi/asm/cachectl.h| 2 +-
 arch/nds32/include/uapi/asm/param.h   | 2 +-
 arch/nds32/include/uapi/asm/ptrace.h  | 2 +-
 arch/nds32/include/uapi/asm/sigcontext.h  | 2 +-
 arch/nds32/include/uapi/asm/unistd.h  | 2 +-
 arch/powerpc/include/asm/pnv-ocxl.h   | 2 +-
 arch/sh/drivers/pci/pci-sh5.h | 4 ++--
 arch/sh/drivers/pci/pci-sh7751.h  | 4 ++--
 arch/sh/drivers/pci/pci-sh7780.h  | 4 ++--
 arch/sh/drivers/pci/pcie-sh7786.h | 4 ++--
 arch/sh/include/asm/addrspace.h   | 4 ++--
 arch/sh/include/asm/bl_bit_64.h   | 4 ++--
 arch/sh/include/asm/cache_insns_64.h  | 4 ++--
 arch/sh/include/asm/device.h  | 4 ++--
 arch/sh/include/asm/dma-register.h| 4 ++--
 arch/sh/include/asm/dma.h | 4 ++--
 arch/sh/include/asm/dwarf.h   | 4 ++--
 arch/sh/include/asm/fixmap.h  | 4 ++--
 arch/sh/include/asm/flat.h| 4 ++--
 arch/sh/include/asm/freq.h| 4 ++--
 arch/sh/include/asm/gpio.h| 4 ++--
 arch/sh/include/asm/machvec.h | 4 ++--
 arch/sh/include/asm/pgtable.h | 4 ++--
 arch/sh/include/asm/sfp-machine.h | 4 ++--
 arch/sh/include/asm/shmparam.h| 4 ++--
 arch/sh/include/asm/siu.h | 4 ++--
 arch/sh/include/asm/spinlock-cas.h| 4 ++--
 arch/sh/include/asm/spinlock-llsc.h   | 4 ++--
 arch/sh/include/asm/spinlock.h| 4 ++--
 arch/sh/include/asm/switch_to.h   | 4 ++--
 arch/sh/include/asm/switch_to_64.h| 4 ++--
 arch/sh/include/asm/tlb_64.h  | 4 ++--
 arch/sh/include/asm/traps_64.h| 4 ++--
 arch/sh/include/asm/watchdog.h| 4 ++--
 arch/sh/include

[PATCH] ARM: dts: imx6ull: Use the correct style for SPDX License Identifier

2019-03-11 Thread Nishad Kamdar
This patch corrects the SPDX License Identifier style
in imx6ull-pinfunc-snvs.h.

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46
and making some manual changes.

Suggested-by: Joe Perches 
Signed-off-by: Nishad Kamdar 
---
 arch/arm/boot/dts/imx6ull-pinfunc-snvs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6ull-pinfunc-snvs.h 
b/arch/arm/boot/dts/imx6ull-pinfunc-snvs.h
index f6fb6783c193..54cfe72295aa 100644
--- a/arch/arm/boot/dts/imx6ull-pinfunc-snvs.h
+++ b/arch/arm/boot/dts/imx6ull-pinfunc-snvs.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2016 Freescale Semiconductor, Inc.
  * Copyright (C) 2017 NXP
-- 
2.17.1



Re: [PATCH] Use the correct style for SPDX License Identifier in all header files across the kernel

2019-02-18 Thread Nishad Kamdar
On Sat, Feb 16, 2019 at 08:45:07PM +0100, Greg Kroah-Hartman wrote:
> On Sat, Feb 16, 2019 at 04:04:02PM +0530, Nishad Kamdar wrote:
> >  816 files changed, 970 insertions(+), 970 deletions(-)
> 
> You have to break this up into subsystems at the very least, no one
> person can take this patch, sorry.
> 
> greg k-h

Ok, no problem. I'll do that.

Thanks for the review.

Regards,
Nishad


Re: [PATCH] staging: vt6656: Use the correct style for SPDX license Identifier

2019-02-13 Thread Nishad Kamdar
On Wed, Feb 06, 2019 at 11:17:35PM -0800, Joe Perches wrote:
> On Wed, 2019-02-06 at 17:25 +0100, Greg Kroah-Hartman wrote:
> > On Tue, Feb 05, 2019 at 10:59:40AM -0800, Joe Perches wrote:
> > > On Tue, 2019-02-05 at 19:44 +0100, Greg Kroah-Hartman wrote:
> > > > On Tue, Feb 05, 2019 at 08:36:24PM +0530, Nishad Kamdar wrote:
> > > > > This patch corrects the style for SPDX license Identifier in mac.h
> > > > > by using "/* */" in place of "//" as per Linux kernel licensing rules.
> > > > > Issue found by checkpatch.
> > > > > 
> > > > > Signed-off-by: Nishad Kamdar 
> > > > > ---
> > > > >  drivers/staging/vt6656/mac.h | 4 ++--
> > > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/staging/vt6656/mac.h 
> > > > > b/drivers/staging/vt6656/mac.h
> > > > > index 94e700fcd0b6..75166020f7c6 100644
> > > > > --- a/drivers/staging/vt6656/mac.h
> > > > > +++ b/drivers/staging/vt6656/mac.h
> > > > > @@ -1,5 +1,5 @@
> > > > > -// SPDX-License-Identifier: GPL-2.0+
> > > > > -/*
> > > > > +/* SPDX-License-Identifier: GPL-2.0+
> > > > 
> > > > Should really be:
> > > > 
> > > > /* SPDX-License-Identifier: GPL-2.0+ */
> > > 
> > > There's a fair number of style inconsistencies in the kernel
> > > sources for that already.
> > > 
> > > ~8% of the .h files that have an 'SPDX-License-Identifier:'
> > > don't use the recommended style.
> > > 
> > > $ git grep -h "SPDX-License" -- '*.h' | \
> > >   perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: 
> > > [^\.].*@Identifier:@' | \
> > >   sort | uniq -c | sort -rn
> > >8506 /* SPDX-License-Identifier: ... */
> > > 593 // SPDX-License-Identifier:
> > > 154 /* SPDX-License-Identifier:
> > >  53  * SPDX-License-Identifier:
> > >   1  * SPDX-License-Identifier:   GPL-2.0
> > >   1 //SPDX-License-Identifier:
> > >   1 /*  SPDX-License-Identifier: ... */
> > 
> > Then let's fix them, the documentation says what the correct format is,
> > there's no reason we can't actually follow what is written...
> 
> So here's a script that does most all of them except
> the 50 or so that use the SPDX-License-Identifier
> in the middle of a comment block.
> 
> Using:
> 
> $ git grep --name-only 'SPDX-License-Identifier:' -- '*.h' | \
>   xargs grep -L '/\* SPDX-License-Identifier:.*\*/'| \
>   while read file ; do perl -i update_spdx.perl $file ; done
> 
> produces
> 
> $ git diff --shortstat
>  748 files changed, 902 insertions(+), 902 deletions(-)
> 
> And
> 
> $ git grep -h "SPDX-License" -- '*.h' | \
>   perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: 
> [^\.].*@Identifier:@' | \
>   sort | uniq -c | sort -rn
>9254 /* SPDX-License-Identifier: ... */
>  53  * SPDX-License-Identifier:
>   1  * SPDX-License-Identifier:   GPL-2.0
>   1 /*  SPDX-License-Identifier: ... */
> 
> and the perl script below is also attached
> 
> $ cat update_spdx.perl
> local $/;
> my $file = (<>);
> 
> my $spdx_regex = '/\*[ \t]*SPDX-License-Identifier:[ \t]*';
> my $spdx_actual = '/* SPDX-License-Identifier: ';
> 
> # any // use converted to /* ... */
> $file =~ s@^//[ \t]*SPDX-License-Identifier:[ \t]*(.*)\n@/* 
> SPDX-License-Identifier: $1 */\n@;
> 
> # first line use with /* without trailing */ gets */ added and 2nd line 
> updated
> $file =~ m@^\s*${spdx_regex}([^\n]+)\n@;
> if (defined $1 && $1 !~ m@\*/$@) {
> $file =~ s@^[ \t]*${spdx_regex}([^\n]+)\n@${spdx_actual}$1 */\n/* @;
> $file =~ s@^[ \t]*${spdx_regex}([^\n]+)\n[ \t]*/\*[ 
> \t]+\*@${spdx_actual}$1\n/* @;
> $file =~ s@^\s*${spdx_regex}([^\n]+)\n/\* \n@${spdx_actual}$1\n/*\n@;
> }
> 
> print $file;
> 

Ok, Thanks for the suggestion and the script.

I'll try to use it and correct the format.

Thanks and regards,
Nishad


Re: [PATCH] staging: vt6656: Use the correct style for SPDX license Identifier

2019-02-12 Thread Nishad Kamdar
On Tue, Feb 05, 2019 at 07:44:31PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Feb 05, 2019 at 08:36:24PM +0530, Nishad Kamdar wrote:
> > This patch corrects the style for SPDX license Identifier in mac.h
> > by using "/* */" in place of "//" as per Linux kernel licensing rules.
> > Issue found by checkpatch.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> >  drivers/staging/vt6656/mac.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h
> > index 94e700fcd0b6..75166020f7c6 100644
> > --- a/drivers/staging/vt6656/mac.h
> > +++ b/drivers/staging/vt6656/mac.h
> > @@ -1,5 +1,5 @@
> > -// SPDX-License-Identifier: GPL-2.0+
> > -/*
> > +/* SPDX-License-Identifier: GPL-2.0+
> 
> Should really be:
> 
> /* SPDX-License-Identifier: GPL-2.0+ */
> 
> thanks,
> 
> greg k-h

Ok, i'll modify it.

Thanks for the review.

Regards,
Nishad


[PATCH v2] staging: vt6656: Use the correct style for SPDX license Identifier

2019-02-06 Thread Nishad Kamdar
This patch corrects the style for SPDX license Identifier in mac.h
by using "/* */" in place of "//" as per Linux kernel licensing rules.
Issue found by checkpatch.

Signed-off-by: Nishad Kamdar 
---
Changes in v2:
  - Use the "/* */" comment style specifically for the SPDX identifier
as per licensing rules.
---
 drivers/staging/vt6656/mac.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h
index 94e700fcd0b6..3fd87f95c524 100644
--- a/drivers/staging/vt6656/mac.h
+++ b/drivers/staging/vt6656/mac.h
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  * All rights reserved.
-- 
2.17.1



[PATCH] staging: vt6656: Use the correct style for SPDX license Identifier

2019-02-05 Thread Nishad Kamdar
This patch corrects the style for SPDX license Identifier in mac.h
by using "/* */" in place of "//" as per Linux kernel licensing rules.
Issue found by checkpatch.

Signed-off-by: Nishad Kamdar 
---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h
index 94e700fcd0b6..75166020f7c6 100644
--- a/drivers/staging/vt6656/mac.h
+++ b/drivers/staging/vt6656/mac.h
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+
+ *
  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  * All rights reserved.
  *
-- 
2.17.1



Re: [PATCH] MIPS: Select PINCTRL_RT2880 when RALINK is enabled

2019-01-30 Thread Nishad Kamdar
On Tue, Jan 29, 2019 at 08:09:07PM +, Paul Burton wrote:
> Hi Nishad,
> 
> On Tue, Jan 29, 2019 at 08:55:27PM +0530, Nishad Kamdar wrote:
> > This patch selects config PINCTRL_RT2880 when config RALINK is
> > enabled as per drivers/staging/mt7621-pinctrl/TODO list. PINCTRL
> > is also selected when RALINK is enabled to avoid config dependency
> > warnings.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> >  arch/mips/Kconfig | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> > index e2fc88da0223..cea529cf6284 100644
> > --- a/arch/mips/Kconfig
> > +++ b/arch/mips/Kconfig
> > @@ -623,6 +623,8 @@ config RALINK
> > select CLKDEV_LOOKUP
> > select ARCH_HAS_RESET_CONTROLLER
> > select RESET_CONTROLLER
> > +   select PINCTRL
> > +   select PINCTRL_RT2880
> >  
> >  config SGI_IP22
> > bool "SGI IP22 (Indy/Indigo2)"
> 
> Wouldn't this also require selecting STAGING? Perhaps that's why it
> wasn't done in the first place?
> 
> Thanks,
> Paul
Ok, got it.

Thanks for the review.

Regards,
Nishad


[PATCH] staging: mt7621-pinctrl: Test devm_kzalloc for failure while improving the code

2019-01-29 Thread Nishad Kamdar
This patch tests the return of devm_kzalloc for failure and
improves the code.

Signed-off-by: Nishad Kamdar 
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c 
b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 3e959fa73703..9b52d44abef1 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -350,7 +350,6 @@ static int rt2880_pinmux_probe(struct platform_device *pdev)
for_each_compatible_node(np, NULL, "ralink,rt2880-gpio") {
const __be32 *ngpio, *gpiobase;
struct pinctrl_gpio_range *range;
-   char *name;
 
if (!of_device_is_available(np))
continue;
@@ -362,9 +361,10 @@ static int rt2880_pinmux_probe(struct platform_device 
*pdev)
return -EINVAL;
}
 
-   range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL);
-   range->name = name = (char *)[1];
-   sprintf(name, "pio");
+   range = devm_kzalloc(p->dev, sizeof(*range), GFP_KERNEL);
+   if (!range)
+   return -ENOMEM;
+   range->name = "pio";
range->npins = __be32_to_cpu(*ngpio);
range->base = __be32_to_cpu(*gpiobase);
range->pin_base = range->base;
-- 
2.17.1



[PATCH] MIPS: Select PINCTRL_RT2880 when RALINK is enabled

2019-01-29 Thread Nishad Kamdar
This patch selects config PINCTRL_RT2880 when config RALINK is
enabled as per drivers/staging/mt7621-pinctrl/TODO list. PINCTRL
is also selected when RALINK is enabled to avoid config dependency
warnings.

Signed-off-by: Nishad Kamdar 
---
 arch/mips/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e2fc88da0223..cea529cf6284 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -623,6 +623,8 @@ config RALINK
select CLKDEV_LOOKUP
select ARCH_HAS_RESET_CONTROLLER
select RESET_CONTROLLER
+   select PINCTRL
+   select PINCTRL_RT2880
 
 config SGI_IP22
bool "SGI IP22 (Indy/Indigo2)"
-- 
2.17.1



Re: [PATCH] staging: mt7621-pinctrl: Remove space after cast

2019-01-25 Thread Nishad Kamdar
On Wed, Jan 23, 2019 at 09:45:53AM -0800, Joe Perches wrote:
> On Wed, 2019-01-23 at 22:01 +0530, Nishad Kamdar wrote:
> > This patch removes space after a cast as it
> > is not needed.
> > Issue found by checkpatch.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> >  drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c 
> > b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > index 80e7067cfb79..3e959fa73703 100644
> > --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > @@ -363,7 +363,7 @@ static int rt2880_pinmux_probe(struct platform_device 
> > *pdev)
> > }
> >  
> > range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL);
> > -   range->name = name = (char *) [1];
> > +   range->name = name = (char *)[1];
> > sprintf(name, "pio");
> 
> I find this code unsightly and fragile.
> It doesn't test the return of devm_kzalloc for failure.
> 
> This might as well be
> ---
>  drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c 
> b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> index 80e7067cfb79..9b52d44abef1 100644
> --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> @@ -350,7 +350,6 @@ static int rt2880_pinmux_probe(struct platform_device 
> *pdev)
>   for_each_compatible_node(np, NULL, "ralink,rt2880-gpio") {
>   const __be32 *ngpio, *gpiobase;
>   struct pinctrl_gpio_range *range;
> - char *name;
>  
>   if (!of_device_is_available(np))
>   continue;
> @@ -362,9 +361,10 @@ static int rt2880_pinmux_probe(struct platform_device 
> *pdev)
>   return -EINVAL;
>   }
>  
> - range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL);
> - range->name = name = (char *) [1];
> - sprintf(name, "pio");
> + range = devm_kzalloc(p->dev, sizeof(*range), GFP_KERNEL);
> + if (!range)
> + return -ENOMEM;
> + range->name = "pio";
>   range->npins = __be32_to_cpu(*ngpio);
>   range->base = __be32_to_cpu(*gpiobase);
>   range->pin_base = range->base;
>   
>   
> 

Ok, I'll include it as a new patch as I think this one has already been
accepted.

Thanks for the review.

Regards,
Nishad


[PATCH] staging: mt7621-pinctrl: Remove space after cast

2019-01-23 Thread Nishad Kamdar
This patch removes space after a cast as it
is not needed.
Issue found by checkpatch.

Signed-off-by: Nishad Kamdar 
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c 
b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 80e7067cfb79..3e959fa73703 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -363,7 +363,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev)
}
 
range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL);
-   range->name = name = (char *) [1];
+   range->name = name = (char *)[1];
sprintf(name, "pio");
range->npins = __be32_to_cpu(*ngpio);
range->base = __be32_to_cpu(*gpiobase);
-- 
2.17.1



[PATCH v3] Staging: fbtft: Switch to the gpio descriptor interface

2019-01-16 Thread Nishad Kamdar
This switches the fbtft driver to use GPIO descriptors
rather than numerical gpios:

Utilize the GPIO library's intrinsic handling of OF GPIOs
and polarity. If the line is flagged active low, gpiolib
will deal with this.

Remove gpios from platform device structure. Neither assign
statically numbers to gpios in platform device nor allow
gpios to be parsed as module parameters.

Signed-off-by: Nishad Kamdar 
---
Changes in v3:
 - Correct the changelog position.
Changes in v2:
 - Merge all patches in a single patch. This is because the
   first patch changes par->gpio from an int to a pointer
   so all the checks have to be updated in the same patch.
   Otherwie it breaks 'git bisect'.
---
 drivers/staging/fbtft/fb_agm1264k-fl.c |  52 ++--
 drivers/staging/fbtft/fb_bd663474.c|   6 +-
 drivers/staging/fbtft/fb_ili9163.c |   6 +-
 drivers/staging/fbtft/fb_ili9320.c |   2 +-
 drivers/staging/fbtft/fb_ili9325.c |   6 +-
 drivers/staging/fbtft/fb_ili9340.c |   2 +-
 drivers/staging/fbtft/fb_pcd8544.c |   4 +-
 drivers/staging/fbtft/fb_ra8875.c  |   4 +-
 drivers/staging/fbtft/fb_s6d1121.c |   6 +-
 drivers/staging/fbtft/fb_sh1106.c  |   2 +-
 drivers/staging/fbtft/fb_ssd1289.c |   6 +-
 drivers/staging/fbtft/fb_ssd1305.c |   4 +-
 drivers/staging/fbtft/fb_ssd1306.c |   4 +-
 drivers/staging/fbtft/fb_ssd1325.c |   6 +-
 drivers/staging/fbtft/fb_ssd1331.c |  10 +-
 drivers/staging/fbtft/fb_ssd1351.c |   2 +-
 drivers/staging/fbtft/fb_tls8204.c |   6 +-
 drivers/staging/fbtft/fb_uc1611.c  |   4 +-
 drivers/staging/fbtft/fb_uc1701.c  |   6 +-
 drivers/staging/fbtft/fb_upd161704.c   |   6 +-
 drivers/staging/fbtft/fb_watterott.c   |   4 +-
 drivers/staging/fbtft/fbtft-bus.c  |   6 +-
 drivers/staging/fbtft/fbtft-core.c | 173 +++--
 drivers/staging/fbtft/fbtft-io.c   |  26 +-
 drivers/staging/fbtft/fbtft.h  |  21 +-
 drivers/staging/fbtft/fbtft_device.c   | 344 +
 drivers/staging/fbtft/flexfb.c |  12 +-
 27 files changed, 143 insertions(+), 587 deletions(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c 
b/drivers/staging/fbtft/fb_agm1264k-fl.c
index f6f30f5bf15a..8f27bd8da17d 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -8,7 +8,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -79,14 +79,14 @@ static int init_display(struct fbtft_par *par)
 
 static void reset(struct fbtft_par *par)
 {
-   if (par->gpio.reset == -1)
+   if (!par->gpio.reset)
return;
 
dev_dbg(par->info->device, "%s()\n", __func__);
 
-   gpio_set_value(par->gpio.reset, 0);
+   gpiod_set_value(par->gpio.reset, 0);
udelay(20);
-   gpio_set_value(par->gpio.reset, 1);
+   gpiod_set_value(par->gpio.reset, 1);
mdelay(120);
 }
 
@@ -98,30 +98,30 @@ static int verify_gpios(struct fbtft_par *par)
dev_dbg(par->info->device,
"%s()\n", __func__);
 
-   if (par->EPIN < 0) {
+   if (!par->EPIN) {
dev_err(par->info->device,
"Missing info about 'wr' (aka E) gpio. Aborting.\n");
return -EINVAL;
}
for (i = 0; i < 8; ++i) {
-   if (par->gpio.db[i] < 0) {
+   if (!par->gpio.db[i]) {
dev_err(par->info->device,
"Missing info about 'db[%i]' gpio. Aborting.\n",
i);
return -EINVAL;
}
}
-   if (par->CS0 < 0) {
+   if (!par->CS0) {
dev_err(par->info->device,
"Missing info about 'cs0' gpio. Aborting.\n");
return -EINVAL;
}
-   if (par->CS1 < 0) {
+   if (!par->CS1) {
dev_err(par->info->device,
"Missing info about 'cs1' gpio. Aborting.\n");
return -EINVAL;
}
-   if (par->RW < 0) {
+   if (!par->RW) {
dev_err(par->info->device,
"Missing info about 'rw' gpio. Aborting.\n");
return -EINVAL;
@@ -139,22 +139,22 @@ request_gpios_match(struct fbtft_par *par, const struct 
fbtft_gpio *gpio)
if (strcasecmp(gpio->name, "wr") == 0) {
/* left ks0108 E pin */
par->EPIN = gpio->gpio;
-   return GPIOF_OUT_INIT_LOW;
+   return GPIOD_OUT_LOW;
} else if (strcasecmp(gpio->name, "cs0") == 0) {
/* left ks0108 controller pin */
par->CS0 = gpio->gpio;
-   return GPIOF_OUT_INIT_HIGH;
+   return GPIOD_OUT

Re: [PATCH v2] Staging: fbtft: Switch to the gpio descriptor interface

2019-01-16 Thread Nishad Kamdar
On Tue, Jan 15, 2019 at 04:02:31PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Jan 15, 2019 at 10:17:09AM +0530, Nishad Kamdar wrote:
> > This switches the fbtft driver to use GPIO descriptors
> > rather than numerical gpios:
> > 
> > Utilize the GPIO library's intrinsic handling of OF GPIOs
> > and polarity. If the line is flagged active low, gpiolib
> > will deal with this.
> > 
> > Remove gpios from platform device structure. Neither assign
> > statically numbers to gpios in platform device nor allow
> > gpios to be parsed as module parameters.
> > 
> > Signed-off-by: Nishad Kamdar 
> > Changes in v2:
> >  - Merge all patches in a single patch. This is because the
> >first patch changes par->gpio from an int to a pointer
> >so all the checks have to be updated in the same patch.
> >Otherwie it breaks 'git bisect'.
> 
> The "v2" information goes below the --- line please.
> 
> Also, I got 2 copies of this, both different, so I have no idea which to
> apply.  Please fix up and resend a v3.
> 
Sorry for the confusion. I'll fix and resend.

> thanks,
> 
> greg k-h

Thanks for the review.

Regards,
Nishad


[PATCH v2] Staging: fbtft: Switch to the gpio descriptor interface

2019-01-14 Thread Nishad Kamdar
This switches the fbtft driver to use GPIO descriptors
rather than numerical gpios:

Utilize the GPIO library's intrinsic handling of OF GPIOs
and polarity. If the line is flagged active low, gpiolib
will deal with this.

Remove gpios from platform device structure. Neither assign
statically numbers to gpios in platform device nor allow
gpios to be parsed as module parameters.

Signed-off-by: Nishad Kamdar 
Changes in v2:
 - Merge all patches in a single patch. This is because the
   first patch changes par->gpio from an int to a pointer
   so all the checks have to be updated in the same patch.
   Otherwie it breaks 'git bisect'.
---
 drivers/staging/fbtft/fb_agm1264k-fl.c |  52 ++--
 drivers/staging/fbtft/fb_bd663474.c|   6 +-
 drivers/staging/fbtft/fb_ili9163.c |   6 +-
 drivers/staging/fbtft/fb_ili9320.c |   2 +-
 drivers/staging/fbtft/fb_ili9325.c |   6 +-
 drivers/staging/fbtft/fb_ili9340.c |   2 +-
 drivers/staging/fbtft/fb_pcd8544.c |   4 +-
 drivers/staging/fbtft/fb_ra8875.c  |   4 +-
 drivers/staging/fbtft/fb_s6d1121.c |   6 +-
 drivers/staging/fbtft/fb_sh1106.c  |   2 +-
 drivers/staging/fbtft/fb_ssd1289.c |   6 +-
 drivers/staging/fbtft/fb_ssd1305.c |   4 +-
 drivers/staging/fbtft/fb_ssd1306.c |   4 +-
 drivers/staging/fbtft/fb_ssd1325.c |   6 +-
 drivers/staging/fbtft/fb_ssd1331.c |  10 +-
 drivers/staging/fbtft/fb_ssd1351.c |   2 +-
 drivers/staging/fbtft/fb_tls8204.c |   6 +-
 drivers/staging/fbtft/fb_uc1611.c  |   4 +-
 drivers/staging/fbtft/fb_uc1701.c  |   6 +-
 drivers/staging/fbtft/fb_upd161704.c   |   6 +-
 drivers/staging/fbtft/fb_watterott.c   |   4 +-
 drivers/staging/fbtft/fbtft-bus.c  |   6 +-
 drivers/staging/fbtft/fbtft-core.c | 173 +++--
 drivers/staging/fbtft/fbtft-io.c   |  26 +-
 drivers/staging/fbtft/fbtft.h  |  21 +-
 drivers/staging/fbtft/fbtft_device.c   | 344 +
 drivers/staging/fbtft/flexfb.c |  12 +-
 27 files changed, 143 insertions(+), 587 deletions(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c 
b/drivers/staging/fbtft/fb_agm1264k-fl.c
index f6f30f5bf15a..8f27bd8da17d 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -8,7 +8,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -79,14 +79,14 @@ static int init_display(struct fbtft_par *par)
 
 static void reset(struct fbtft_par *par)
 {
-   if (par->gpio.reset == -1)
+   if (!par->gpio.reset)
return;
 
dev_dbg(par->info->device, "%s()\n", __func__);
 
-   gpio_set_value(par->gpio.reset, 0);
+   gpiod_set_value(par->gpio.reset, 0);
udelay(20);
-   gpio_set_value(par->gpio.reset, 1);
+   gpiod_set_value(par->gpio.reset, 1);
mdelay(120);
 }
 
@@ -98,30 +98,30 @@ static int verify_gpios(struct fbtft_par *par)
dev_dbg(par->info->device,
"%s()\n", __func__);
 
-   if (par->EPIN < 0) {
+   if (!par->EPIN) {
dev_err(par->info->device,
"Missing info about 'wr' (aka E) gpio. Aborting.\n");
return -EINVAL;
}
for (i = 0; i < 8; ++i) {
-   if (par->gpio.db[i] < 0) {
+   if (!par->gpio.db[i]) {
dev_err(par->info->device,
"Missing info about 'db[%i]' gpio. Aborting.\n",
i);
return -EINVAL;
}
}
-   if (par->CS0 < 0) {
+   if (!par->CS0) {
dev_err(par->info->device,
"Missing info about 'cs0' gpio. Aborting.\n");
return -EINVAL;
}
-   if (par->CS1 < 0) {
+   if (!par->CS1) {
dev_err(par->info->device,
"Missing info about 'cs1' gpio. Aborting.\n");
return -EINVAL;
}
-   if (par->RW < 0) {
+   if (!par->RW) {
dev_err(par->info->device,
"Missing info about 'rw' gpio. Aborting.\n");
return -EINVAL;
@@ -139,22 +139,22 @@ request_gpios_match(struct fbtft_par *par, const struct 
fbtft_gpio *gpio)
if (strcasecmp(gpio->name, "wr") == 0) {
/* left ks0108 E pin */
par->EPIN = gpio->gpio;
-   return GPIOF_OUT_INIT_LOW;
+   return GPIOD_OUT_LOW;
} else if (strcasecmp(gpio->name, "cs0") == 0) {
/* left ks0108 controller pin */
par->CS0 = gpio->gpio;
-   return GPIOF_OUT_INIT_HIGH;
+   return GPIOD_OUT_HIGH;
} else if (strcasecmp(gpio->name, "cs1

Re: [PATCH v6 0/2] greybus: gpio: Switch to the gpio descriptor interface

2019-01-14 Thread Nishad Kamdar
On Mon, Jan 14, 2019 at 10:05:17AM +0100, Johan Hovold wrote:
> On Fri, Jan 11, 2019 at 09:03:16PM +0530, Nishad Kamdar wrote:
> > This patch series converts uses of the old GPIO API to the GPIO
> > descriptor API. It also converts the GPIO driver to use the
> > GPIO irqchip library GPIOLIB_IRQCHIP instead of repimplementing
> > the same.
> > 
> > Changes in v6:
> >  - Patchset now contains two patches as the patch
> >1 has been accepted.
> 
> All three patches look good now, but since Greg picks these up directly
> and applies them to the staging tree, it is best if you submit all three
> patches (with my reviewed-by tag) in a series.
> 
Sure, I'll do that.
> One last resend as v7?
> 
> Thanks again for doing this.
> 
> Johan

Thanks for all the reviews.

Regards,
Nishad


[PATCH v7 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2019-01-14 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface while continuing to ignore gpio flags from device tree in
"svc_reset_onoff()" for now.

Reviewed-by: Johan Hovold 
Signed-off-by: Nishad Kamdar 
---
Changes in v7:
  - No change.
Changes in v6:
  - Make error messages consistent.
Changes in v5:
  - Change the commit message.
  - Restore the names of the gpio device-tree properties without
the "-gpio" suffix.
Changes in v4:
 - Move 'gpio_desc *svc_sysboot' below the reset flag
   as it is more logical to have reset flag below
   reset gpio.
 - Remove a few unnecessary line breaks.
Changes in v3:
 - Add this patch to a patchset.
Changes in v2:
 - Move comment to the same line as to what it applies to.
---
 drivers/staging/greybus/arche-platform.c | 124 ---
 1 file changed, 41 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 4c36e88766e7..6eb842040c22 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -8,10 +8,9 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,14 +44,14 @@ enum svc_wakedetect_state {
 
 struct arche_platform_drvdata {
/* Control GPIO signals to and from AP <=> SVC */
-   int svc_reset_gpio;
+   struct gpio_desc *svc_reset;
bool is_reset_act_hi;
-   int svc_sysboot_gpio;
-   int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
+   struct gpio_desc *svc_sysboot;
+   struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
signals */
 
enum arche_platform_state state;
 
-   int svc_refclk_req;
+   struct gpio_desc *svc_refclk_req;
struct clk *svc_ref_clk;
 
struct pinctrl *pinctrl;
@@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
arche_pdata->wake_detect_state = state;
 }
 
-static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
+static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
 {
-   gpio_set_value(gpio, onoff);
+   gpiod_set_raw_value(gpio, onoff);
 }
 
 static int apb_cold_boot(struct device *dev, void *data)
@@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
 static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
*arche_pdata)
 {
/* Enable interrupt here, to read event back from SVC */
-   gpio_direction_input(arche_pdata->wake_detect_gpio);
enable_irq(arche_pdata->wake_detect_irq);
 }
 
@@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
*devid)
 
spin_lock_irqsave(_pdata->wake_lock, flags);
 
-   if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
+   if (gpiod_get_value(arche_pdata->wake_detect)) {
/* wake/detect rising */
 
/*
@@ -224,10 +222,9 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
 
dev_info(arche_pdata->dev, "Booting from cold boot state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
+   gpiod_set_value(arche_pdata->svc_sysboot, 0);
usleep_range(100, 200);
 
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
@@ -238,8 +235,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
}
 
/* bring SVC out of reset */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
 
@@ -259,10 +255,9 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
 
dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 1);
+   gpiod_set_value(arche_pdata->svc_sysboot, 1);
 
usleep_range(100, 200);
 
@@ -273,8 +268,7 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
return ret;
}
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHI

[PATCH v7 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2019-01-14 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface while continuing to ignore gpio flags from device tree in
functions "deassert_reset()" and "assert_reset()" for now.

Reviewed-by: Johan Hovold 
Signed-off-by: Nishad Kamdar 
---
Changes in v7:
 - No change.
Changes in v6:
 - Remove some unnecessary line breaks.
Changes in v5:
 - Change the commit message.
 - Restore the names of the gpio device-tree properties without
   the "-gpio" suffix.
Changes in v4:
 - Use gpiod_set_raw_value() for deassert_reset() and
   assert_reset() as gpiod_set_value() will change the
   sematics of these calls by taking any gpio flags
   into account.
 - Remove some unnecesssary line breaks.
 - Restore 'spi_en' gpio check in fw_flashing_seq()
   as it is currently optional.
Changes in v3:
 - Add this patch in a patchset.
Changes in v2:
 - Resolved compilation errors.
---
 drivers/staging/greybus/arche-apb-ctrl.c | 152 +--
 1 file changed, 61 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
b/drivers/staging/greybus/arche-apb-ctrl.c
index be5ffed90bcf..bbf3ba744fc4 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -8,9 +8,8 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
 
 struct arche_apb_ctrl_drvdata {
/* Control GPIO signals to and from AP <=> AP Bridges */
-   int resetn_gpio;
-   int boot_ret_gpio;
-   int pwroff_gpio;
-   int wake_in_gpio;
-   int wake_out_gpio;
-   int pwrdn_gpio;
+   struct gpio_desc *resetn;
+   struct gpio_desc *boot_ret;
+   struct gpio_desc *pwroff;
+   struct gpio_desc *wake_in;
+   struct gpio_desc *wake_out;
+   struct gpio_desc *pwrdn;
 
enum arche_platform_state state;
bool init_disabled;
@@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
struct regulator *vcore;
struct regulator *vio;
 
-   int clk_en_gpio;
+   struct gpio_desc *clk_en;
struct clk *clk;
 
struct pinctrl *pinctrl;
struct pinctrl_state *pin_default;
 
/* V2: SPI Bus control  */
-   int spi_en_gpio;
+   struct gpio_desc *spi_en;
bool spi_en_polarity_high;
 };
 
 /*
  * Note that these low level api's are active high
  */
-static inline void deassert_reset(unsigned int gpio)
+static inline void deassert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 1);
+   gpiod_set_raw_value(gpio, 1);
 }
 
-static inline void assert_reset(unsigned int gpio)
+static inline void assert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 0);
+   gpiod_set_raw_value(gpio, 0);
 }
 
 /*
@@ -75,11 +74,10 @@ static int coldboot_seq(struct platform_device *pdev)
return 0;
 
/* Hold APB in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
 
-   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
-   gpio_is_valid(apb->spi_en_gpio))
-   devm_gpio_free(dev, apb->spi_en_gpio);
+   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
+   devm_gpiod_put(dev, apb->spi_en);
 
/* Enable power to APB */
if (!IS_ERR(apb->vcore)) {
@@ -101,13 +99,13 @@ static int coldboot_seq(struct platform_device *pdev)
apb_bootret_deassert(dev);
 
/* On DB3 clock was not mandatory */
-   if (gpio_is_valid(apb->clk_en_gpio))
-   gpio_set_value(apb->clk_en_gpio, 1);
+   if (apb->clk_en)
+   gpiod_set_value(apb->clk_en, 1);
 
usleep_range(100, 200);
 
/* deassert reset to APB : Active-low signal */
-   deassert_reset(apb->resetn_gpio);
+   deassert_reset(apb->resetn);
 
apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
 
@@ -136,25 +134,25 @@ static int fw_flashing_seq(struct platform_device *pdev)
return ret;
}
 
-   if (gpio_is_valid(apb->spi_en_gpio)) {
+   if (apb->spi_en) {
unsigned long flags;
 
if (apb->spi_en_polarity_high)
-   flags = GPIOF_OUT_INIT_HIGH;
+   flags = GPIOD_OUT_HIGH;
else
-   flags = GPIOF_OUT_INIT_LOW;
+   flags = GPIOD_OUT_LOW;
 
-   ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
-   flags, "apb_spi_en");
-   if (ret) {
-   dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
-   apb->spi_en_gpio);
+   apb->spi_en = devm_gpiod_get(dev, "spi-en", flags);
+   if (IS_E

[PATCH v7 1/3] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP

2019-01-14 Thread Nishad Kamdar
Convert the GPIO driver to use the GPIO irqchip library
GPIOLIB_IRQCHIP instead of reimplementing the same.

Reviewed-by: Johan Hovold 
Signed-off-by: Nishad Kamdar 
---
Changes in v7:
 - No change.
Changes in v5:
 - Restore "struct irq_chip irqc" in "struct gb_gpio_controller"
   This is because we cannot use the gpio-chip irqchip, as that
   will register the irqchip automatically and possibly in an
   incompatible way.
Changes in v4:
 - Remove changes related to conversion to gpiochip_get_data() to
   include it as a new patch.
 - Remove the 'struct irq_chip' field from 'struct gb_gpio_controller'
   as struct gpio_chip will have an irqchip whenever
   CONFIG_GPIOLIB_IRQCHIP is selected.
 - Update the TODO file as per the changes.
Changes in v3:
 - Combine patches as into a patch series.
Changes in v2:
 - Retained irq.h and irqdomain.h headers.
 - Dropped function gb_gpio_irqchip_add() and
   called gpiochip_irqchip_add() from probe().
 - Referred 
https://lkml.kernel.org/r/1476054589-28422-1-git-send-email-linus.wall...@linaro.org.
---
 drivers/staging/greybus/Kconfig |   1 +
 drivers/staging/greybus/TODO|   2 -
 drivers/staging/greybus/gpio.c  | 156 ++--
 3 files changed, 11 insertions(+), 148 deletions(-)

diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index ab096bcef98c..b571e4e8060b 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -148,6 +148,7 @@ if GREYBUS_BRIDGED_PHY
 config GREYBUS_GPIO
tristate "Greybus GPIO Bridged PHY driver"
depends on GPIOLIB
+   select GPIOLIB_IRQCHIP
---help---
  Select this option if you have a device that follows the
  Greybus GPIO Bridged PHY Class specification.
diff --git a/drivers/staging/greybus/TODO b/drivers/staging/greybus/TODO
index 3b90a5711998..31f1f2cb401c 100644
--- a/drivers/staging/greybus/TODO
+++ b/drivers/staging/greybus/TODO
@@ -1,5 +1,3 @@
 * Convert all uses of the old GPIO API from  to the
   GPIO descriptor API in  and look up GPIO
   lines from device tree or ACPI.
-* Convert the GPIO driver to use the GPIO irqchip library
-  GPIOLIB_IRQCHIP instead of reimplementing the same.
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index e110681e6f86..3151004d26fb 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -9,9 +9,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 
 #include "greybus.h"
@@ -39,11 +39,6 @@ struct gb_gpio_controller {
 
struct gpio_chipchip;
struct irq_chip irqc;
-   struct irq_chip *irqchip;
-   struct irq_domain   *irqdomain;
-   unsigned intirq_base;
-   irq_flow_handler_t  irq_handler;
-   unsigned intirq_default_type;
struct mutexirq_lock;
 };
 #define gpio_chip_to_gb_gpio_controller(chip) \
@@ -391,7 +386,7 @@ static int gb_gpio_request_handler(struct gb_operation *op)
return -EINVAL;
}
 
-   irq = irq_find_mapping(ggc->irqdomain, event->which);
+   irq = irq_find_mapping(ggc->chip.irq.domain, event->which);
if (!irq) {
dev_err(dev, "failed to find IRQ\n");
return -EINVAL;
@@ -506,135 +501,6 @@ static int gb_gpio_controller_setup(struct 
gb_gpio_controller *ggc)
return ret;
 }
 
-/**
- * gb_gpio_irq_map() - maps an IRQ into a GB gpio irqchip
- * @d: the irqdomain used by this irqchip
- * @irq: the global irq number used by this GB gpio irqchip irq
- * @hwirq: the local IRQ/GPIO line offset on this GB gpio
- *
- * This function will set up the mapping for a certain IRQ line on a
- * GB gpio by assigning the GB gpio as chip data, and using the irqchip
- * stored inside the GB gpio.
- */
-static int gb_gpio_irq_map(struct irq_domain *domain, unsigned int irq,
-  irq_hw_number_t hwirq)
-{
-   struct gpio_chip *chip = domain->host_data;
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
-
-   irq_set_chip_data(irq, ggc);
-   irq_set_chip_and_handler(irq, ggc->irqchip, ggc->irq_handler);
-   irq_set_noprobe(irq);
-   /*
-* No set-up of the hardware will happen if IRQ_TYPE_NONE
-* is passed as default type.
-*/
-   if (ggc->irq_default_type != IRQ_TYPE_NONE)
-   irq_set_irq_type(irq, ggc->irq_default_type);
-
-   return 0;
-}
-
-static void gb_gpio_irq_unmap(struct irq_domain *d, unsigned int irq)
-{
-   irq_set_chip_and_handler(irq, NULL, NULL);
-   irq_set_chip_data(irq, NULL);
-}
-
-static const struct irq_domain_ops gb_gpio_domain_ops = {
-   .map= gb_gpio_irq_map,
-   .unmap  = gb_gpio_irq_unmap,
-};
-
-/**
- * gb_gpio_irqchip_remove() - removes an irqchip added to a g

[PATCH v7 0/3] greybus: gpio: Switch to the gpio descriptor interface

2019-01-14 Thread Nishad Kamdar
This patch series converts uses of the old GPIO API to the GPIO
descriptor API. It also converts the GPIO driver to use the
GPIO irqchip library GPIOLIB_IRQCHIP instead of repimplementing
the same.

Chnages in v7:
 - Combine the three patches together.
Changes in v6:
 - Patchset now contains two patches as the patch
   1 has been accepted.
 - Changes mentioned in individual patches of the set.
Changes in v5:
 - Drop the patch which uses gpiochip_get_data() in place of
   gpio_chip_to_gb_gpio_controller() as of now.
 - This is because it currently breaks the driver, since
   gpiochip_add() sets the data pointer to NULL.  
Changes in v4:
 - Changes mentioned in individual patches of the set.
Changes in v3:
 - Combines the latest versions of the three greybus patches together
   in a patch series.

Nishad Kamdar (3):
  staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP
  staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor
interface
  staging: greybus: arche-platform: Switch to the gpio descriptor
interface

 drivers/staging/greybus/Kconfig  |   1 +
 drivers/staging/greybus/TODO |   2 -
 drivers/staging/greybus/arche-apb-ctrl.c | 152 +-
 drivers/staging/greybus/arche-platform.c | 124 ++
 drivers/staging/greybus/gpio.c   | 156 ++-
 5 files changed, 113 insertions(+), 322 deletions(-)

-- 
2.17.1



Re: [PATCH v5 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2019-01-13 Thread Nishad Kamdar
On Fri, Jan 11, 2019 at 09:41:34AM +0100, Johan Hovold wrote:
> On Thu, Jan 10, 2019 at 11:21:04PM +0530, Nishad Kamdar wrote:
> > Use the gpiod interface instead of the deprecated old non-descriptor
> > interface while continuing to ignore gpio flags from device tree in
> > functions "deassert_reset()" and "assert_reset()" for now.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> > Changes in v5:
> >  - Change the commit message.
> >  - Restore the names of the gpio device-tree properties without
> >the "-gpio" suffix.
> > Changes in v4:
> >  - Use gpiod_set_raw_value() for deassert_reset() and
> >assert_reset() as gpiod_set_value() will change the
> >sematics of these calls by taking any gpio flags
> >into account.
> >  - Remove some unnecesssary line breaks.
> >  - Restore 'spi_en' gpio check in fw_flashing_seq()
> >as it is currently optional.
> > Changes in v3:
> >  - Add this patch in a patchset.
> > Changes in v2:
> >  - Resolved compilation errors.
> > ---
> 
> Also looks good now. You can add my
> 
> Reviewed-by: Johan Hovold 
> 
> Found one really minor nit below, which doesn't really need to be fixed,
> but since you may need to update the third patch, you might as well
> consider this too.
> 
Ok, I'll do that.
> > /* It's not mandatory to support power management interface */
> > -   apb->pwroff_gpio = of_get_named_gpio(np, "pwr-off-gpios", 0);
> > -   if (apb->pwroff_gpio < 0) {
> > -   dev_err(dev, "failed to get power off gpio\n");
> > -   return apb->pwroff_gpio;
> > -   }
> > -   ret = devm_gpio_request_one(dev, apb->pwroff_gpio,
> > -   GPIOF_IN, "pwroff_n");
> > -   if (ret) {
> > -   dev_err(dev, "Failed requesting pwroff_n gpio %d\n",
> > -   apb->pwroff_gpio);
> > +   apb->pwroff = devm_gpiod_get_optional(dev, "pwr-off",
> > + GPIOD_IN);
> 
> Looks like you don't need to break the above statement any more either.
> 
> > +   if (IS_ERR(apb->pwroff)) {
> > +   ret = PTR_ERR(apb->pwroff);
> > +   dev_err(dev, "Failed requesting pwroff_n GPIO: %d\n", ret);
> > return ret;
> > }
> >  
> > /* Do not make clock mandatory as of now (for DB3) */
> > -   apb->clk_en_gpio = of_get_named_gpio(np, "clock-en-gpio", 0);
> > -   if (apb->clk_en_gpio < 0) {
> > -   dev_warn(dev, "failed to get clock en gpio\n");
> > -   } else if (gpio_is_valid(apb->clk_en_gpio)) {
> > -   ret = devm_gpio_request_one(dev, apb->clk_en_gpio,
> > -   GPIOF_OUT_INIT_LOW, "apb_clk_en");
> > -   if (ret) {
> > -   dev_warn(dev, "Failed requesting APB clock en gpio 
> > %d\n",
> > -apb->clk_en_gpio);
> > -   return ret;
> > -   }
> > +   apb->clk_en = devm_gpiod_get_optional(dev, "clock-en",
> > + GPIOD_OUT_LOW);
> 
> Same here?
> 
Ok, I'll do that.

Thanks and regards,
Nishad
> > +   if (IS_ERR(apb->clk_en)) {
> > +   ret = PTR_ERR(apb->clk_en);
> > +   dev_err(dev, "Failed requesting APB clock en GPIO: %d\n", ret);
> > +   return ret;
> > }
> 
> Johan


Re: [PATCH v5 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2019-01-13 Thread Nishad Kamdar
On Fri, Jan 11, 2019 at 09:48:21AM +0100, Johan Hovold wrote:
> On Thu, Jan 10, 2019 at 11:23:07PM +0530, Nishad Kamdar wrote:
> > Use the gpiod interface instead of the deprecated old non-descriptor
> > interface while continuing to ignore gpio flags from device tree in
> > "svc_reset_onoff()" for now.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> > Changes in v5:
> >   - Change the commit message.
> >   - Restore the names of the gpio device-tree properties without
> > the "-gpio" suffix.
> > Changes in v4:
> >  - Move 'gpio_desc *svc_sysboot' below the reset flag
> >as it is more logical to have reset flag below
> >reset gpio.
> >  - Remove a few unnecessary line breaks.
> > Changes in v3:
> >  - Add this patch to a patchset.
> > Changes in v2:
> >  - Move comment to the same line as to what it applies to.
> > ---
> 
> Also looks good. Some really minor comments to a couple of the error
> messages. The issues are there in the current code, but since you modify
> these messages anyway you might as well fix them up. Please fix that and
> resend with my
> 
> Reviewed-by: Johan Hovold 
> 
Ok, I'll do that.

> Really good job with this!
> 
Thank you.
> > @@ -435,6 +428,7 @@ static int arche_platform_probe(struct platform_device 
> > *pdev)
> > struct device *dev = >dev;
> > struct device_node *np = dev->of_node;
> > int ret;
> > +   unsigned int flags;
> >  
> > arche_pdata = devm_kzalloc(>dev, sizeof(*arche_pdata),
> >GFP_KERNEL);
> > @@ -444,61 +438,33 @@ static int arche_platform_probe(struct 
> > platform_device *pdev)
> > /* setup svc reset gpio */
> > arche_pdata->is_reset_act_hi = of_property_read_bool(np,
> >  
> > "svc,reset-active-high");
> > -   arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
> > -   "svc,reset-gpio",
> > -   0);
> > -   if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
> > -   dev_err(dev, "failed to get reset-gpio\n");
> > -   return arche_pdata->svc_reset_gpio;
> > -   }
> > -   ret = devm_gpio_request(dev, arche_pdata->svc_reset_gpio, "svc-reset");
> > -   if (ret) {
> > -   dev_err(dev, "failed to request svc-reset gpio:%d\n", ret);
> > -   return ret;
> > -   }
> > -   ret = gpio_direction_output(arche_pdata->svc_reset_gpio,
> > -   arche_pdata->is_reset_act_hi);
> > -   if (ret) {
> > -   dev_err(dev, "failed to set svc-reset gpio dir:%d\n", ret);
> > +   if (arche_pdata->is_reset_act_hi)
> > +   flags = GPIOD_OUT_HIGH;
> > +   else
> > +   flags = GPIOD_OUT_LOW;
> > +
> > +   arche_pdata->svc_reset = devm_gpiod_get(dev, "svc,reset", flags);
> > +   if (IS_ERR(arche_pdata->svc_reset)) {
> > +   ret = PTR_ERR(arche_pdata->svc_reset);
> > +   dev_err(dev, "failed to request svc-reset GPIO:%d\n", ret);
> 
> Add a space after ':' for consistency.
> 
Ok. I'll do that.
> > @@ -515,19 +481,11 @@ static int arche_platform_probe(struct 
> > platform_device *pdev)
> > arche_pdata->num_apbs = of_get_child_count(np);
> > dev_dbg(dev, "Number of APB's available - %d\n", arche_pdata->num_apbs);
> >  
> > -   arche_pdata->wake_detect_gpio = of_get_named_gpio(np,
> > - 
> > "svc,wake-detect-gpio",
> > - 0);
> > -   if (arche_pdata->wake_detect_gpio < 0) {
> > -   dev_err(dev, "failed to get wake detect gpio\n");
> > -   return arche_pdata->wake_detect_gpio;
> > -   }
> > -
> > -   ret = devm_gpio_request(dev, arche_pdata->wake_detect_gpio,
> > -   "wake detect");
> > -   if (ret) {
> > -   dev_err(dev, "Failed requesting wake_detect gpio %d\n",
> > -   arche_pdata->wake_detect_gpio);
> > +   arche_pdata->wake_detect = devm_gpiod_get(dev, "svc,wake-detect",
> > + GPIOD_IN);
> > +   if (IS_ERR(arche_pdata->wake_detect)) {
> > +   ret = PTR_ERR(arche_pdata->wake_detect);
> > +   dev_err(dev, "Failed requesting wake_detect GPIO %d\n", ret);
> 
> Add colon after "GPIO" for consistency (and to avoid ambiguity).
> 

Ok, I'll do that.

Thanks for the review,
Nishad
> > return ret;
> > }
> 
> Thanks,
> Johan


[PATCH v6 2/2] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2019-01-11 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface while continuing to ignore gpio flags from device tree in
"svc_reset_onoff()" for now.

Reviewed-by: Johan Hovold 
Signed-off-by: Nishad Kamdar 
---
Changes in v6:
  - Make error messages consistent.
Changes in v5:
  - Change the commit message.
  - Restore the names of the gpio device-tree properties without
the "-gpio" suffix.
Changes in v4:
 - Move 'gpio_desc *svc_sysboot' below the reset flag
   as it is more logical to have reset flag below
   reset gpio.
 - Remove a few unnecessary line breaks.
Changes in v3:
 - Add this patch to a patchset.
Changes in v2:
 - Move comment to the same line as to what it applies to.
---
 drivers/staging/greybus/arche-platform.c | 124 ---
 1 file changed, 41 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 4c36e88766e7..6eb842040c22 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -8,10 +8,9 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,14 +44,14 @@ enum svc_wakedetect_state {
 
 struct arche_platform_drvdata {
/* Control GPIO signals to and from AP <=> SVC */
-   int svc_reset_gpio;
+   struct gpio_desc *svc_reset;
bool is_reset_act_hi;
-   int svc_sysboot_gpio;
-   int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
+   struct gpio_desc *svc_sysboot;
+   struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
signals */
 
enum arche_platform_state state;
 
-   int svc_refclk_req;
+   struct gpio_desc *svc_refclk_req;
struct clk *svc_ref_clk;
 
struct pinctrl *pinctrl;
@@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
arche_pdata->wake_detect_state = state;
 }
 
-static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
+static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
 {
-   gpio_set_value(gpio, onoff);
+   gpiod_set_raw_value(gpio, onoff);
 }
 
 static int apb_cold_boot(struct device *dev, void *data)
@@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
 static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
*arche_pdata)
 {
/* Enable interrupt here, to read event back from SVC */
-   gpio_direction_input(arche_pdata->wake_detect_gpio);
enable_irq(arche_pdata->wake_detect_irq);
 }
 
@@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
*devid)
 
spin_lock_irqsave(_pdata->wake_lock, flags);
 
-   if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
+   if (gpiod_get_value(arche_pdata->wake_detect)) {
/* wake/detect rising */
 
/*
@@ -224,10 +222,9 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
 
dev_info(arche_pdata->dev, "Booting from cold boot state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
+   gpiod_set_value(arche_pdata->svc_sysboot, 0);
usleep_range(100, 200);
 
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
@@ -238,8 +235,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
}
 
/* bring SVC out of reset */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
 
@@ -259,10 +255,9 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
 
dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 1);
+   gpiod_set_value(arche_pdata->svc_sysboot, 1);
 
usleep_range(100, 200);
 
@@ -273,8 +268,7 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
return ret;
}
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHING);
 
@@ -305,8 +299,7 @@ arche_pla

[PATCH v6 1/2] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2019-01-11 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface while continuing to ignore gpio flags from device tree in
functions "deassert_reset()" and "assert_reset()" for now.

Reviewed-by: Johan Hovold 
Signed-off-by: Nishad Kamdar 
---
Changes in v6:
 - Remove some unnecessary line breaks.
Changes in v5:
 - Change the commit message.
 - Restore the names of the gpio device-tree properties without
   the "-gpio" suffix.
Changes in v4:
 - Use gpiod_set_raw_value() for deassert_reset() and
   assert_reset() as gpiod_set_value() will change the
   sematics of these calls by taking any gpio flags
   into account.
 - Remove some unnecesssary line breaks.
 - Restore 'spi_en' gpio check in fw_flashing_seq()
   as it is currently optional.
Changes in v3:
 - Add this patch in a patchset.
Changes in v2:
 - Resolved compilation errors.
---
 drivers/staging/greybus/arche-apb-ctrl.c | 152 +--
 1 file changed, 61 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
b/drivers/staging/greybus/arche-apb-ctrl.c
index be5ffed90bcf..bbf3ba744fc4 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -8,9 +8,8 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
 
 struct arche_apb_ctrl_drvdata {
/* Control GPIO signals to and from AP <=> AP Bridges */
-   int resetn_gpio;
-   int boot_ret_gpio;
-   int pwroff_gpio;
-   int wake_in_gpio;
-   int wake_out_gpio;
-   int pwrdn_gpio;
+   struct gpio_desc *resetn;
+   struct gpio_desc *boot_ret;
+   struct gpio_desc *pwroff;
+   struct gpio_desc *wake_in;
+   struct gpio_desc *wake_out;
+   struct gpio_desc *pwrdn;
 
enum arche_platform_state state;
bool init_disabled;
@@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
struct regulator *vcore;
struct regulator *vio;
 
-   int clk_en_gpio;
+   struct gpio_desc *clk_en;
struct clk *clk;
 
struct pinctrl *pinctrl;
struct pinctrl_state *pin_default;
 
/* V2: SPI Bus control  */
-   int spi_en_gpio;
+   struct gpio_desc *spi_en;
bool spi_en_polarity_high;
 };
 
 /*
  * Note that these low level api's are active high
  */
-static inline void deassert_reset(unsigned int gpio)
+static inline void deassert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 1);
+   gpiod_set_raw_value(gpio, 1);
 }
 
-static inline void assert_reset(unsigned int gpio)
+static inline void assert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 0);
+   gpiod_set_raw_value(gpio, 0);
 }
 
 /*
@@ -75,11 +74,10 @@ static int coldboot_seq(struct platform_device *pdev)
return 0;
 
/* Hold APB in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
 
-   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
-   gpio_is_valid(apb->spi_en_gpio))
-   devm_gpio_free(dev, apb->spi_en_gpio);
+   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
+   devm_gpiod_put(dev, apb->spi_en);
 
/* Enable power to APB */
if (!IS_ERR(apb->vcore)) {
@@ -101,13 +99,13 @@ static int coldboot_seq(struct platform_device *pdev)
apb_bootret_deassert(dev);
 
/* On DB3 clock was not mandatory */
-   if (gpio_is_valid(apb->clk_en_gpio))
-   gpio_set_value(apb->clk_en_gpio, 1);
+   if (apb->clk_en)
+   gpiod_set_value(apb->clk_en, 1);
 
usleep_range(100, 200);
 
/* deassert reset to APB : Active-low signal */
-   deassert_reset(apb->resetn_gpio);
+   deassert_reset(apb->resetn);
 
apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
 
@@ -136,25 +134,25 @@ static int fw_flashing_seq(struct platform_device *pdev)
return ret;
}
 
-   if (gpio_is_valid(apb->spi_en_gpio)) {
+   if (apb->spi_en) {
unsigned long flags;
 
if (apb->spi_en_polarity_high)
-   flags = GPIOF_OUT_INIT_HIGH;
+   flags = GPIOD_OUT_HIGH;
else
-   flags = GPIOF_OUT_INIT_LOW;
+   flags = GPIOD_OUT_LOW;
 
-   ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
-   flags, "apb_spi_en");
-   if (ret) {
-   dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
-   apb->spi_en_gpio);
+   apb->spi_en = devm_gpiod_get(dev, "spi-en", flags);
+   if (IS_E

[PATCH v6 0/2] greybus: gpio: Switch to the gpio descriptor interface

2019-01-11 Thread Nishad Kamdar
This patch series converts uses of the old GPIO API to the GPIO
descriptor API. It also converts the GPIO driver to use the
GPIO irqchip library GPIOLIB_IRQCHIP instead of repimplementing
the same.

Changes in v6:
 - Patchset now contains two patches as the patch
   1 has been accepted.
 - Changes mentioned in individual patches of the set.
Changes in v5:
 - Drop the patch which uses gpiochip_get_data() in place of
   gpio_chip_to_gb_gpio_controller() as of now.
 - This is because it currently breaks the driver, since
   gpiochip_add() sets the data pointer to NULL.  
Changes in v4:
 - Changes mentioned in individual patches of the set.
Changes in v3:
 - Combines the latest versions of the three greybus patches together
   in a patch series.

Nishad Kamdar (2):
  staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor
interface
  staging: greybus: arche-platform: Switch to the gpio descriptor
interface

 drivers/staging/greybus/arche-apb-ctrl.c | 152 +--
 drivers/staging/greybus/arche-platform.c | 124 ++
 2 files changed, 102 insertions(+), 174 deletions(-)

-- 
2.17.1



[PATCH v5 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2019-01-10 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface while continuing to ignore gpio flags from device tree in
"svc_reset_onoff()" for now.

Signed-off-by: Nishad Kamdar 
---
Changes in v5:
  - Change the commit message.
  - Restore the names of the gpio device-tree properties without
the "-gpio" suffix.
Changes in v4:
 - Move 'gpio_desc *svc_sysboot' below the reset flag
   as it is more logical to have reset flag below
   reset gpio.
 - Remove a few unnecessary line breaks.
Changes in v3:
 - Add this patch to a patchset.
Changes in v2:
 - Move comment to the same line as to what it applies to.
---
 drivers/staging/greybus/arche-platform.c | 124 ---
 1 file changed, 41 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 4c36e88766e7..77ac474e2423 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -8,10 +8,9 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,14 +44,14 @@ enum svc_wakedetect_state {
 
 struct arche_platform_drvdata {
/* Control GPIO signals to and from AP <=> SVC */
-   int svc_reset_gpio;
+   struct gpio_desc *svc_reset;
bool is_reset_act_hi;
-   int svc_sysboot_gpio;
-   int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
+   struct gpio_desc *svc_sysboot;
+   struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
signals */
 
enum arche_platform_state state;
 
-   int svc_refclk_req;
+   struct gpio_desc *svc_refclk_req;
struct clk *svc_ref_clk;
 
struct pinctrl *pinctrl;
@@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
arche_pdata->wake_detect_state = state;
 }
 
-static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
+static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
 {
-   gpio_set_value(gpio, onoff);
+   gpiod_set_raw_value(gpio, onoff);
 }
 
 static int apb_cold_boot(struct device *dev, void *data)
@@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
 static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
*arche_pdata)
 {
/* Enable interrupt here, to read event back from SVC */
-   gpio_direction_input(arche_pdata->wake_detect_gpio);
enable_irq(arche_pdata->wake_detect_irq);
 }
 
@@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
*devid)
 
spin_lock_irqsave(_pdata->wake_lock, flags);
 
-   if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
+   if (gpiod_get_value(arche_pdata->wake_detect)) {
/* wake/detect rising */
 
/*
@@ -224,10 +222,9 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
 
dev_info(arche_pdata->dev, "Booting from cold boot state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
+   gpiod_set_value(arche_pdata->svc_sysboot, 0);
usleep_range(100, 200);
 
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
@@ -238,8 +235,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
}
 
/* bring SVC out of reset */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
 
@@ -259,10 +255,9 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
 
dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 1);
+   gpiod_set_value(arche_pdata->svc_sysboot, 1);
 
usleep_range(100, 200);
 
@@ -273,8 +268,7 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
return ret;
}
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHING);
 
@@ -305,8 +299,7 @@ arche_platform_poweroff_seq(struct arche_platform_drvdata 
*arche_pdata)
clk_

[PATCH v5 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2019-01-10 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface while continuing to ignore gpio flags from device tree in
functions "deassert_reset()" and "assert_reset()" for now.

Signed-off-by: Nishad Kamdar 
---
Changes in v5:
 - Change the commit message.
 - Restore the names of the gpio device-tree properties without
   the "-gpio" suffix.
Changes in v4:
 - Use gpiod_set_raw_value() for deassert_reset() and
   assert_reset() as gpiod_set_value() will change the
   sematics of these calls by taking any gpio flags
   into account.
 - Remove some unnecesssary line breaks.
 - Restore 'spi_en' gpio check in fw_flashing_seq()
   as it is currently optional.
Changes in v3:
 - Add this patch in a patchset.
Changes in v2:
 - Resolved compilation errors.
---
 drivers/staging/greybus/arche-apb-ctrl.c | 154 ++-
 1 file changed, 63 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
b/drivers/staging/greybus/arche-apb-ctrl.c
index be5ffed90bcf..35a03ca6bb22 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -8,9 +8,8 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
 
 struct arche_apb_ctrl_drvdata {
/* Control GPIO signals to and from AP <=> AP Bridges */
-   int resetn_gpio;
-   int boot_ret_gpio;
-   int pwroff_gpio;
-   int wake_in_gpio;
-   int wake_out_gpio;
-   int pwrdn_gpio;
+   struct gpio_desc *resetn;
+   struct gpio_desc *boot_ret;
+   struct gpio_desc *pwroff;
+   struct gpio_desc *wake_in;
+   struct gpio_desc *wake_out;
+   struct gpio_desc *pwrdn;
 
enum arche_platform_state state;
bool init_disabled;
@@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
struct regulator *vcore;
struct regulator *vio;
 
-   int clk_en_gpio;
+   struct gpio_desc *clk_en;
struct clk *clk;
 
struct pinctrl *pinctrl;
struct pinctrl_state *pin_default;
 
/* V2: SPI Bus control  */
-   int spi_en_gpio;
+   struct gpio_desc *spi_en;
bool spi_en_polarity_high;
 };
 
 /*
  * Note that these low level api's are active high
  */
-static inline void deassert_reset(unsigned int gpio)
+static inline void deassert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 1);
+   gpiod_set_raw_value(gpio, 1);
 }
 
-static inline void assert_reset(unsigned int gpio)
+static inline void assert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 0);
+   gpiod_set_raw_value(gpio, 0);
 }
 
 /*
@@ -75,11 +74,10 @@ static int coldboot_seq(struct platform_device *pdev)
return 0;
 
/* Hold APB in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
 
-   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
-   gpio_is_valid(apb->spi_en_gpio))
-   devm_gpio_free(dev, apb->spi_en_gpio);
+   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
+   devm_gpiod_put(dev, apb->spi_en);
 
/* Enable power to APB */
if (!IS_ERR(apb->vcore)) {
@@ -101,13 +99,13 @@ static int coldboot_seq(struct platform_device *pdev)
apb_bootret_deassert(dev);
 
/* On DB3 clock was not mandatory */
-   if (gpio_is_valid(apb->clk_en_gpio))
-   gpio_set_value(apb->clk_en_gpio, 1);
+   if (apb->clk_en)
+   gpiod_set_value(apb->clk_en, 1);
 
usleep_range(100, 200);
 
/* deassert reset to APB : Active-low signal */
-   deassert_reset(apb->resetn_gpio);
+   deassert_reset(apb->resetn);
 
apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
 
@@ -136,25 +134,25 @@ static int fw_flashing_seq(struct platform_device *pdev)
return ret;
}
 
-   if (gpio_is_valid(apb->spi_en_gpio)) {
+   if (apb->spi_en) {
unsigned long flags;
 
if (apb->spi_en_polarity_high)
-   flags = GPIOF_OUT_INIT_HIGH;
+   flags = GPIOD_OUT_HIGH;
else
-   flags = GPIOF_OUT_INIT_LOW;
+   flags = GPIOD_OUT_LOW;
 
-   ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
-   flags, "apb_spi_en");
-   if (ret) {
-   dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
-   apb->spi_en_gpio);
+   apb->spi_en = devm_gpiod_get(dev, "spi-en", flags);
+   if (IS_ERR(apb->spi_en)) {
+   ret = PTR_ERR(apb->spi_en)

[PATCH v5 1/3] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP

2019-01-10 Thread Nishad Kamdar
Convert the GPIO driver to use the GPIO irqchip library
GPIOLIB_IRQCHIP instead of reimplementing the same.

Signed-off-by: Nishad Kamdar 
---
Changes in v5:
 - Restore "struct irq_chip irqc" in "struct gb_gpio_controller"
   This is because we cannot use the gpio-chip irqchip, as that
   will register the irqchip automatically and possibly in an
   incompatible way.
Changes in v4:
 - Remove changes related to conversion to gpiochip_get_data() to
   include it as a new patch.
 - Remove the 'struct irq_chip' field from 'struct gb_gpio_controller'
   as struct gpio_chip will have an irqchip whenever
   CONFIG_GPIOLIB_IRQCHIP is selected.
 - Update the TODO file as per the changes.
Changes in v3:
 - Combine patches as into a patch series.
Changes in v2:
 - Retained irq.h and irqdomain.h headers.
 - Dropped function gb_gpio_irqchip_add() and
   called gpiochip_irqchip_add() from probe().
 - Referred 
https://lkml.kernel.org/r/1476054589-28422-1-git-send-email-linus.wall...@linaro.org.
---
 drivers/staging/greybus/Kconfig |   1 +
 drivers/staging/greybus/TODO|   2 -
 drivers/staging/greybus/gpio.c  | 156 ++--
 3 files changed, 11 insertions(+), 148 deletions(-)

diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index ab096bcef98c..b571e4e8060b 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -148,6 +148,7 @@ if GREYBUS_BRIDGED_PHY
 config GREYBUS_GPIO
tristate "Greybus GPIO Bridged PHY driver"
depends on GPIOLIB
+   select GPIOLIB_IRQCHIP
---help---
  Select this option if you have a device that follows the
  Greybus GPIO Bridged PHY Class specification.
diff --git a/drivers/staging/greybus/TODO b/drivers/staging/greybus/TODO
index 3b90a5711998..31f1f2cb401c 100644
--- a/drivers/staging/greybus/TODO
+++ b/drivers/staging/greybus/TODO
@@ -1,5 +1,3 @@
 * Convert all uses of the old GPIO API from  to the
   GPIO descriptor API in  and look up GPIO
   lines from device tree or ACPI.
-* Convert the GPIO driver to use the GPIO irqchip library
-  GPIOLIB_IRQCHIP instead of reimplementing the same.
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index e110681e6f86..3151004d26fb 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -9,9 +9,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 
 #include "greybus.h"
@@ -39,11 +39,6 @@ struct gb_gpio_controller {
 
struct gpio_chipchip;
struct irq_chip irqc;
-   struct irq_chip *irqchip;
-   struct irq_domain   *irqdomain;
-   unsigned intirq_base;
-   irq_flow_handler_t  irq_handler;
-   unsigned intirq_default_type;
struct mutexirq_lock;
 };
 #define gpio_chip_to_gb_gpio_controller(chip) \
@@ -391,7 +386,7 @@ static int gb_gpio_request_handler(struct gb_operation *op)
return -EINVAL;
}
 
-   irq = irq_find_mapping(ggc->irqdomain, event->which);
+   irq = irq_find_mapping(ggc->chip.irq.domain, event->which);
if (!irq) {
dev_err(dev, "failed to find IRQ\n");
return -EINVAL;
@@ -506,135 +501,6 @@ static int gb_gpio_controller_setup(struct 
gb_gpio_controller *ggc)
return ret;
 }
 
-/**
- * gb_gpio_irq_map() - maps an IRQ into a GB gpio irqchip
- * @d: the irqdomain used by this irqchip
- * @irq: the global irq number used by this GB gpio irqchip irq
- * @hwirq: the local IRQ/GPIO line offset on this GB gpio
- *
- * This function will set up the mapping for a certain IRQ line on a
- * GB gpio by assigning the GB gpio as chip data, and using the irqchip
- * stored inside the GB gpio.
- */
-static int gb_gpio_irq_map(struct irq_domain *domain, unsigned int irq,
-  irq_hw_number_t hwirq)
-{
-   struct gpio_chip *chip = domain->host_data;
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
-
-   irq_set_chip_data(irq, ggc);
-   irq_set_chip_and_handler(irq, ggc->irqchip, ggc->irq_handler);
-   irq_set_noprobe(irq);
-   /*
-* No set-up of the hardware will happen if IRQ_TYPE_NONE
-* is passed as default type.
-*/
-   if (ggc->irq_default_type != IRQ_TYPE_NONE)
-   irq_set_irq_type(irq, ggc->irq_default_type);
-
-   return 0;
-}
-
-static void gb_gpio_irq_unmap(struct irq_domain *d, unsigned int irq)
-{
-   irq_set_chip_and_handler(irq, NULL, NULL);
-   irq_set_chip_data(irq, NULL);
-}
-
-static const struct irq_domain_ops gb_gpio_domain_ops = {
-   .map= gb_gpio_irq_map,
-   .unmap  = gb_gpio_irq_unmap,
-};
-
-/**
- * gb_gpio_irqchip_remove() - removes an irqchip added to a gb_gpio_controller
- * @ggc: the gb_gpio_controller to remove the irq

[PATCH v5 0/3] greybus: gpio: Switch to the gpio descriptor interface

2019-01-10 Thread Nishad Kamdar
This patch series converts uses of the old GPIO API to the GPIO
descriptor API. It also converts the GPIO driver to use the
GPIO irqchip library GPIOLIB_IRQCHIP instead of repimplementing
the same.

Changes in v5:
 - Drop the patch which uses gpiochip_get_data() in place of
   gpio_chip_to_gb_gpio_controller() as of now.
 - This is because it currently breaks the driver, since
   gpiochip_add() sets the data pointer to NULL.  
Changes in v4:
 - Changes mentioned in individual patches of the set.
Changes in v3:
 - Combines the latest versions of the three greybus patches together
   in a patch series.

Nishad Kamdar (3):
  staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP
  staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor
interface
  staging: greybus: arche-platform: Switch to the gpio descriptor
interface

 drivers/staging/greybus/Kconfig  |   1 +
 drivers/staging/greybus/TODO |   2 -
 drivers/staging/greybus/arche-apb-ctrl.c | 154 +-
 drivers/staging/greybus/arche-platform.c | 124 ++
 drivers/staging/greybus/gpio.c   | 156 ++-
 5 files changed, 115 insertions(+), 322 deletions(-)

-- 
2.17.1



Re: [PATCH v4 4/4] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2019-01-10 Thread Nishad Kamdar
On Wed, Jan 09, 2019 at 12:35:47PM +0100, Johan Hovold wrote:
> On Sat, Dec 22, 2018 at 08:23:02PM +0530, Nishad Kamdar wrote:
> > Use the gpiod interface instead of the deprecated
> > old non-descriptor interface.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> > Changes in v4:
> >  - Move 'gpio_desc *svc_sysboot' below the reset flag
> >as it is more logical to have reset flag below
> >reset gpio.
> >  - Remove a few unnecessary line breaks.
> > Changes in v3:
> >  - Add this patch to a patchset.
> > Changes in v2:
> >  - Move comment to the same line as to what it applies to.
> > ---
> 
> > -static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
> > +static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
> >  {
> > -   gpio_set_value(gpio, onoff);
> > +   gpiod_set_value(gpio, onoff);
> >  }
> 
> Please use the raw interface here too, until we've done away with the
> polarity properties and can honour the generic device tree flags. Please
> make a comment about this in the commit message too.
> 
Ok, I'll do that.
> > @@ -444,61 +438,33 @@ static int arche_platform_probe(struct 
> > platform_device *pdev)
> > /* setup svc reset gpio */
> > arche_pdata->is_reset_act_hi = of_property_read_bool(np,
> >  
> > "svc,reset-active-high");
> > -   arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
> > -   "svc,reset-gpio",
> > -   0);
> > -   if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
> > -   dev_err(dev, "failed to get reset-gpio\n");
> > -   return arche_pdata->svc_reset_gpio;
> > -   }
> > -   ret = devm_gpio_request(dev, arche_pdata->svc_reset_gpio, "svc-reset");
> > -   if (ret) {
> > -   dev_err(dev, "failed to request svc-reset gpio:%d\n", ret);
> > -   return ret;
> > -   }
> > -   ret = gpio_direction_output(arche_pdata->svc_reset_gpio,
> > -   arche_pdata->is_reset_act_hi);
> > -   if (ret) {
> > -   dev_err(dev, "failed to set svc-reset gpio dir:%d\n", ret);
> > +   if (arche_pdata->is_reset_act_hi)
> > +   flags = GPIOD_OUT_HIGH;
> > +   else
> > +   flags = GPIOD_OUT_LOW;
> > +
> > +   arche_pdata->svc_reset = devm_gpiod_get(dev, "svc,reset-gpio", flags);
> 
> Again, you cannot just rename devicetree properties like this. Keep the
> current names for now (and drop the -gpio suffix when requesting).
> 
Ok, I'll so that.
> Johan

Regards,
Nishad



Re: [PATCH v4 3/4] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2019-01-10 Thread Nishad Kamdar
On Wed, Jan 09, 2019 at 12:30:43PM +0100, Johan Hovold wrote:
> On Sat, Dec 22, 2018 at 08:22:09PM +0530, Nishad Kamdar wrote:
> > Use the gpiod interface instead of the deprecated old non-descriptor
> > interface.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> > Changes in v4:
> >  - Use gpiod_set_raw_value() for deassert_reset() and
> >assert_reset() as gpiod_set_value() will change the
> >sematics of these calls by taking any gpio flags
> >into account.
> 
> Please also mention this in the commit message (i.e. that we continue to
> ignore gpio flags from device tree for now).
> 
Ok, I'll do that.
> >  - Remove some unnecesssary line breaks.
> >  - Restore 'spi_en' gpio check in fw_flashing_seq()
> >as it is currently optional.
> > Changes in v3:
> >  - Add this patch in a patchset.
> > Changes in v2:
> >  - Resolved compilation errors.
> > ---
> 
> > @@ -75,11 +74,10 @@ static int coldboot_seq(struct platform_device *pdev)
> > return 0;
> >  
> > /* Hold APB in reset state */
> > -   assert_reset(apb->resetn_gpio);
> > +   assert_reset(apb->resetn);
> >  
> > -   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
> > -   gpio_is_valid(apb->spi_en_gpio))
> > -   devm_gpio_free(dev, apb->spi_en_gpio);
> > +   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
> > +   devm_gpiod_put(dev, apb->spi_en);
> >  
> > /* Enable power to APB */
> > if (!IS_ERR(apb->vcore)) {
> > @@ -101,13 +99,13 @@ static int coldboot_seq(struct platform_device *pdev)
> > apb_bootret_deassert(dev);
> >  
> > /* On DB3 clock was not mandatory */
> > -   if (gpio_is_valid(apb->clk_en_gpio))
> > -   gpio_set_value(apb->clk_en_gpio, 1);
> > +   if (apb->clk_en)
> > +   gpiod_set_value(apb->clk_en, 1);
> >  
> > usleep_range(100, 200);
> >  
> > /* deassert reset to APB : Active-low signal */
> > -   deassert_reset(apb->resetn_gpio);
> > +   deassert_reset(apb->resetn);
> >  
> > apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
> >  
> > @@ -136,25 +134,25 @@ static int fw_flashing_seq(struct platform_device 
> > *pdev)
> > return ret;
> > }
> >  
> > -   if (gpio_is_valid(apb->spi_en_gpio)) {
> > +   if (apb->spi_en) {
> > unsigned long flags;
> >  
> > if (apb->spi_en_polarity_high)
> > -   flags = GPIOF_OUT_INIT_HIGH;
> > +   flags = GPIOD_OUT_HIGH;
> > else
> > -   flags = GPIOF_OUT_INIT_LOW;
> > +   flags = GPIOD_OUT_LOW;
> >  
> > -   ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
> > -   flags, "apb_spi_en");
> > -   if (ret) {
> > -   dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
> > -   apb->spi_en_gpio);
> > +   apb->spi_en = devm_gpiod_get(dev, "gb,spi-en-gpio", flags);
> 
> I just noticed that you change the name of the device-tree property here
> (and later in apb_ctrl_get_devtree_data()). How is that expected to
> work without breaking current systems? This will be unavoidable at some
> point, but must not be snuck into a patch like this without any comment.
> Please keep the current names for now.
> 
Ok, I'll do that.
> I do think you need to drop the "-gpio" suffix when requesting the gpio
> though. Please double check to make sure.
> 

Ok, I'll check it.
> Johan

Thanks for the review.

Regards,
Nishad


Re: [PATCH v4 2/4] staging: greybus: gpio: Use gpiochip_get_data() in place of gpio_chip_to_gb_gpio_controller()

2019-01-10 Thread Nishad Kamdar
On Wed, Jan 09, 2019 at 11:58:24AM +0100, Johan Hovold wrote:
> On Sat, Dec 22, 2018 at 08:21:00PM +0530, Nishad Kamdar wrote:
> > This patch drops gpio_chip_to_gb_gpio_controller(),
> > and uses gpiochip_get_data() to retrieve the container
> > of struct gpio_chip.
> 
> So this will break the driver, since gpiochip_add() sets the data
> pointer to NULL.
> 
> These kind of changes are getting too complicated to do without
> something to test against. We had a module simulator at one point, but
> not sure what the state of that is now.
> 
Ok, I get it.
> I appreciate the effort though, and since we already started, let's try
> to finish, but please drop this patch for now.
> 
Ok I'll do that.
> Johan

Thanks for the review.

Regards,
Nishad


[PATCH] Staging: emxx_udc: Switch to the gpio descriptor interface

2018-12-27 Thread Nishad Kamdar
Convert VBUS GPIO to use GPIO descriptors from 
and stop using the old GPIO API.

Signed-off-by: Nishad Kamdar 
---
 drivers/staging/emxx_udc/emxx_udc.c | 31 +++--
 drivers/staging/emxx_udc/emxx_udc.h |  2 ++
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index 8e8f57c4f029..a913d40f0801 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -27,7 +27,7 @@
 #include 
 
 #include 
-#include 
+#include 
 
 #include "emxx_udc.h"
 
@@ -2220,7 +2220,7 @@ static inline void _nbu2ss_check_vbus(struct nbu2ss_udc 
*udc)
mdelay(VBUS_CHATTERING_MDELAY); /* wait (ms) */
 
/* VBUS ON Check*/
-   reg_dt = gpio_get_value(VBUS_VALUE);
+   reg_dt = gpiod_get_value(vbus_gpio);
if (reg_dt == 0) {
udc->linux_suspended = 0;
 
@@ -2247,7 +2247,7 @@ static inline void _nbu2ss_check_vbus(struct nbu2ss_udc 
*udc)
}
} else {
mdelay(5);  /* wait (5ms) */
-   reg_dt = gpio_get_value(VBUS_VALUE);
+   reg_dt = gpiod_get_value(vbus_gpio);
if (reg_dt == 0)
return;
 
@@ -2311,7 +2311,7 @@ static inline void _nbu2ss_int_usb_suspend(struct 
nbu2ss_udc *udc)
u32 reg_dt;
 
if (udc->usb_suspended == 0) {
-   reg_dt = gpio_get_value(VBUS_VALUE);
+   reg_dt = gpiod_get_value(vbus_gpio);
 
if (reg_dt == 0)
return;
@@ -2351,7 +2351,7 @@ static irqreturn_t _nbu2ss_udc_irq(int irq, void *_udc)
struct nbu2ss_udc   *udc = (struct nbu2ss_udc *)_udc;
struct fc_regs __iomem *preg = udc->p_regs;
 
-   if (gpio_get_value(VBUS_VALUE) == 0) {
+   if (gpiod_get_value(vbus_gpio) == 0) {
_nbu2ss_writel(>USB_INT_STA, ~USB_INT_STA_RW);
_nbu2ss_writel(>USB_INT_ENA, 0);
return IRQ_HANDLED;
@@ -2360,7 +2360,7 @@ static irqreturn_t _nbu2ss_udc_irq(int irq, void *_udc)
spin_lock(>lock);
 
for (;;) {
-   if (gpio_get_value(VBUS_VALUE) == 0) {
+   if (gpiod_get_value(vbus_gpio) == 0) {
_nbu2ss_writel(>USB_INT_STA, ~USB_INT_STA_RW);
_nbu2ss_writel(>USB_INT_ENA, 0);
status = 0;
@@ -2750,7 +2750,7 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep)
 
preg = udc->p_regs;
 
-   data = gpio_get_value(VBUS_VALUE);
+   data = gpiod_get_value(vbus_gpio);
if (data == 0)
return -EINVAL;
 
@@ -2790,7 +2790,7 @@ static void  nbu2ss_ep_fifo_flush(struct usb_ep *_ep)
return;
}
 
-   data = gpio_get_value(VBUS_VALUE);
+   data = gpiod_get_value(vbus_gpio);
if (data == 0)
return;
 
@@ -2832,7 +2832,7 @@ static int nbu2ss_gad_get_frame(struct usb_gadget 
*pgadget)
}
 
udc = container_of(pgadget, struct nbu2ss_udc, gadget);
-   data = gpio_get_value(VBUS_VALUE);
+   data = gpiod_get_value(vbus_gpio);
if (data == 0)
return -EINVAL;
 
@@ -2854,7 +2854,7 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget)
 
udc = container_of(pgadget, struct nbu2ss_udc, gadget);
 
-   data = gpio_get_value(VBUS_VALUE);
+   data = gpiod_get_value(vbus_gpio);
if (data == 0) {
dev_warn(>dev, "VBUS LEVEL = %d\n", data);
return -EINVAL;
@@ -3119,12 +3119,13 @@ static int nbu2ss_drv_probe(struct platform_device 
*pdev)
}
 
/* VBUS Interrupt */
-   irq_set_irq_type(INT_VBUS, IRQ_TYPE_EDGE_BOTH);
-   status = request_irq(INT_VBUS,
+   vbus_irq = gpiod_to_irq(vbus_gpio);
+   irq_set_irq_type(vbus_irq, IRQ_TYPE_EDGE_BOTH);
+   status = request_irq(vbus_irq,
 _nbu2ss_vbus_irq, IRQF_SHARED, driver_name, udc);
 
if (status != 0) {
-   dev_err(udc->dev, "request_irq(INT_VBUS) failed\n");
+   dev_err(udc->dev, "request_irq(vbus_irq) failed\n");
return status;
}
 
@@ -3160,7 +3161,7 @@ static int nbu2ss_drv_remove(struct platform_device *pdev)
}
 
/* Interrupt Handler - Release */
-   free_irq(INT_VBUS, udc);
+   free_irq(vbus_irq, udc);
 
return 0;
 }
@@ -3201,7 +3202,7 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
if (!udc)
return 0;
 
-   data = gpio_get_value(VBUS_VALUE);
+   data = gpiod_get_value(vbus_gpio);
if (data) {
udc->vbus_active = 1;
udc->devstate = USB_STATE_POWERED;
diff --git a/drivers/staging/emxx_udc/emxx_udc.h 
b/drivers/staging/emxx_udc/emxx_udc.h
index e28a74da9633..b8c3dee5626c 100644
-

[PATCH v4 1/4] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP

2018-12-22 Thread Nishad Kamdar
Convert the GPIO driver to use the GPIO irqchip library
GPIOLIB_IRQCHIP instead of reimplementing the same.

Signed-off-by: Nishad Kamdar 
---
Changes in v4:
 - Remove changes related to conversion to gpiochip_get_data() to
   include it as a new patch.
 - Remove the 'struct irq_chip' field from 'struct gb_gpio_controller'
   as struct gpio_chip will have an irqchip whenever
   CONFIG_GPIOLIB_IRQCHIP is selected.
 - Update the TODO file as per the changes.
Changes in v3:
 - Combine patches as into a patch series.
Changes in v2:
 - Retained irq.h and irqdomain.h headers.
 - Dropped function gb_gpio_irqchip_add() and
   called gpiochip_irqchip_add() from probe().
 - Referred 
https://lkml.kernel.org/r/1476054589-28422-1-git-send-email-linus.wall...@linaro.org.
---
 drivers/staging/greybus/Kconfig |   1 +
 drivers/staging/greybus/TODO|   2 -
 drivers/staging/greybus/gpio.c  | 159 +++-
 3 files changed, 12 insertions(+), 150 deletions(-)

diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index ab096bcef98c..b571e4e8060b 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -148,6 +148,7 @@ if GREYBUS_BRIDGED_PHY
 config GREYBUS_GPIO
tristate "Greybus GPIO Bridged PHY driver"
depends on GPIOLIB
+   select GPIOLIB_IRQCHIP
---help---
  Select this option if you have a device that follows the
  Greybus GPIO Bridged PHY Class specification.
diff --git a/drivers/staging/greybus/TODO b/drivers/staging/greybus/TODO
index 3b90a5711998..31f1f2cb401c 100644
--- a/drivers/staging/greybus/TODO
+++ b/drivers/staging/greybus/TODO
@@ -1,5 +1,3 @@
 * Convert all uses of the old GPIO API from  to the
   GPIO descriptor API in  and look up GPIO
   lines from device tree or ACPI.
-* Convert the GPIO driver to use the GPIO irqchip library
-  GPIOLIB_IRQCHIP instead of reimplementing the same.
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index e110681e6f86..1af291aa1b6e 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -9,9 +9,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 
 #include "greybus.h"
@@ -38,12 +38,6 @@ struct gb_gpio_controller {
struct gb_gpio_line *lines;
 
struct gpio_chipchip;
-   struct irq_chip irqc;
-   struct irq_chip *irqchip;
-   struct irq_domain   *irqdomain;
-   unsigned intirq_base;
-   irq_flow_handler_t  irq_handler;
-   unsigned intirq_default_type;
struct mutexirq_lock;
 };
 #define gpio_chip_to_gb_gpio_controller(chip) \
@@ -391,7 +385,7 @@ static int gb_gpio_request_handler(struct gb_operation *op)
return -EINVAL;
}
 
-   irq = irq_find_mapping(ggc->irqdomain, event->which);
+   irq = irq_find_mapping(ggc->chip.irq.domain, event->which);
if (!irq) {
dev_err(dev, "failed to find IRQ\n");
return -EINVAL;
@@ -506,135 +500,6 @@ static int gb_gpio_controller_setup(struct 
gb_gpio_controller *ggc)
return ret;
 }
 
-/**
- * gb_gpio_irq_map() - maps an IRQ into a GB gpio irqchip
- * @d: the irqdomain used by this irqchip
- * @irq: the global irq number used by this GB gpio irqchip irq
- * @hwirq: the local IRQ/GPIO line offset on this GB gpio
- *
- * This function will set up the mapping for a certain IRQ line on a
- * GB gpio by assigning the GB gpio as chip data, and using the irqchip
- * stored inside the GB gpio.
- */
-static int gb_gpio_irq_map(struct irq_domain *domain, unsigned int irq,
-  irq_hw_number_t hwirq)
-{
-   struct gpio_chip *chip = domain->host_data;
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
-
-   irq_set_chip_data(irq, ggc);
-   irq_set_chip_and_handler(irq, ggc->irqchip, ggc->irq_handler);
-   irq_set_noprobe(irq);
-   /*
-* No set-up of the hardware will happen if IRQ_TYPE_NONE
-* is passed as default type.
-*/
-   if (ggc->irq_default_type != IRQ_TYPE_NONE)
-   irq_set_irq_type(irq, ggc->irq_default_type);
-
-   return 0;
-}
-
-static void gb_gpio_irq_unmap(struct irq_domain *d, unsigned int irq)
-{
-   irq_set_chip_and_handler(irq, NULL, NULL);
-   irq_set_chip_data(irq, NULL);
-}
-
-static const struct irq_domain_ops gb_gpio_domain_ops = {
-   .map= gb_gpio_irq_map,
-   .unmap  = gb_gpio_irq_unmap,
-};
-
-/**
- * gb_gpio_irqchip_remove() - removes an irqchip added to a gb_gpio_controller
- * @ggc: the gb_gpio_controller to remove the irqchip from
- *
- * This is called only from gb_gpio_remove()
- */
-static void gb_gpio_irqchip_remove(struct gb_gpio_controller *ggc)
-{
-   unsigned int offset;
-
-   /* Remove all IRQ map

Re: [PATCH v3 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2018-12-22 Thread Nishad Kamdar
On Tue, Dec 18, 2018 at 12:35:40PM +0100, Johan Hovold wrote:
> On Thu, Nov 22, 2018 at 10:38:18PM +0530, Nishad Kamdar wrote:
> > Use the gpiod interface instead of the deprecated old non-descriptor
> > interface.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> > Changes in v2:
> >  - Resolved compilation errors.
> > ---
> >  drivers/staging/greybus/arche-apb-ctrl.c | 159 +--
> >  1 file changed, 65 insertions(+), 94 deletions(-)
> > 
> > diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
> > b/drivers/staging/greybus/arche-apb-ctrl.c
> > index be5ffed90bcf..e887f6aee20b 100644
> > --- a/drivers/staging/greybus/arche-apb-ctrl.c
> > +++ b/drivers/staging/greybus/arche-apb-ctrl.c
> > @@ -8,9 +8,8 @@
> >  
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >  #include 
> > -#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
> >  
> >  struct arche_apb_ctrl_drvdata {
> > /* Control GPIO signals to and from AP <=> AP Bridges */
> > -   int resetn_gpio;
> > -   int boot_ret_gpio;
> > -   int pwroff_gpio;
> > -   int wake_in_gpio;
> > -   int wake_out_gpio;
> > -   int pwrdn_gpio;
> > +   struct gpio_desc *resetn;
> > +   struct gpio_desc *boot_ret;
> > +   struct gpio_desc *pwroff;
> > +   struct gpio_desc *wake_in;
> > +   struct gpio_desc *wake_out;
> > +   struct gpio_desc *pwrdn;
> >  
> > enum arche_platform_state state;
> > bool init_disabled;
> > @@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
> > struct regulator *vcore;
> > struct regulator *vio;
> >  
> > -   int clk_en_gpio;
> > +   struct gpio_desc *clk_en;
> > struct clk *clk;
> >  
> > struct pinctrl *pinctrl;
> > struct pinctrl_state *pin_default;
> >  
> > /* V2: SPI Bus control  */
> > -   int spi_en_gpio;
> > +   struct gpio_desc *spi_en;
> > bool spi_en_polarity_high;
> >  };
> >  
> >  /*
> >   * Note that these low level api's are active high
> >   */
> > -static inline void deassert_reset(unsigned int gpio)
> > +static inline void deassert_reset(struct gpio_desc *gpio)
> >  {
> > -   gpio_set_value(gpio, 1);
> > +   gpiod_set_value(gpio, 1);
> >  }
> >  
> > -static inline void assert_reset(unsigned int gpio)
> > +static inline void assert_reset(struct gpio_desc *gpio)
> >  {
> > -   gpio_set_value(gpio, 0);
> > +   gpiod_set_value(gpio, 0);
> >  }
> 
> As the comment above deassert_reset() suggests, this change will
> actually change the semantics of these calls by taking any gpio flags
> into account (e.g. ACTIVE_LOW which will invert the signals).
> 
> Perhaps you should just use gpiod_set_raw_value() for now, and this can
> be addressed later. Alternatively, drop the comment and invert the
> polarity here and any users will need to update their device trees.
> 
> Either way, mention this in the commit message.
> 
Ok, I'll use the gpiod_set_raw_value().

> >  /*
> > @@ -75,11 +74,11 @@ static int coldboot_seq(struct platform_device *pdev)
> > return 0;
> >  
> > /* Hold APB in reset state */
> > -   assert_reset(apb->resetn_gpio);
> > +   assert_reset(apb->resetn);
> >  
> > if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
> > -   gpio_is_valid(apb->spi_en_gpio))
> > -   devm_gpio_free(dev, apb->spi_en_gpio);
> > +   apb->spi_en)
> 
> No need to break the line any more.
> 
Ok.

> > +   devm_gpiod_put(dev, apb->spi_en);
> >  
> > /* Enable power to APB */
> > if (!IS_ERR(apb->vcore)) {
> > @@ -101,13 +100,13 @@ static int coldboot_seq(struct platform_device *pdev)
> > apb_bootret_deassert(dev);
> >  
> > /* On DB3 clock was not mandatory */
> > -   if (gpio_is_valid(apb->clk_en_gpio))
> > -   gpio_set_value(apb->clk_en_gpio, 1);
> > +   if (apb->clk_en)
> > +   gpiod_set_value(apb->clk_en, 1);
> >  
> > usleep_range(100, 200);
> >  
> > /* deassert reset to APB : Active-low signal */
> > -   deassert_reset(apb->resetn_gpio);
> > +   deassert_reset(apb->resetn);
> >  
> > apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
> >  
> > @@ -119,6 +118,7 @@ static int fw_flashing_seq(struct platform_device *pdev)
> >

[PATCH v4 2/4] staging: greybus: gpio: Use gpiochip_get_data() in place of gpio_chip_to_gb_gpio_controller()

2018-12-22 Thread Nishad Kamdar
This patch drops gpio_chip_to_gb_gpio_controller(),
and uses gpiochip_get_data() to retrieve the container
of struct gpio_chip.

Signed-off-by: Nishad Kamdar 
---
Changes in v4:
 - Introduce this change as a new patch.
---
 drivers/staging/greybus/gpio.c | 28 +---
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index 1af291aa1b6e..2dd04682cbc6 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -40,8 +40,6 @@ struct gb_gpio_controller {
struct gpio_chipchip;
struct mutexirq_lock;
 };
-#define gpio_chip_to_gb_gpio_controller(chip) \
-   container_of(chip, struct gb_gpio_controller, chip)
 #define irq_data_to_gpio_chip(d) (d->domain->host_data)
 
 static int gb_gpio_line_count_operation(struct gb_gpio_controller *ggc)
@@ -270,7 +268,7 @@ static void _gb_gpio_irq_set_type(struct gb_gpio_controller 
*ggc,
 static void gb_gpio_irq_mask(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
line->masked = true;
@@ -280,7 +278,7 @@ static void gb_gpio_irq_mask(struct irq_data *d)
 static void gb_gpio_irq_unmask(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
line->masked = false;
@@ -290,7 +288,7 @@ static void gb_gpio_irq_unmask(struct irq_data *d)
 static int gb_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
struct device *dev = >gbphy_dev->dev;
u8 irq_type;
@@ -328,7 +326,7 @@ static int gb_gpio_irq_set_type(struct irq_data *d, 
unsigned int type)
 static void gb_gpio_irq_bus_lock(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
mutex_lock(>irq_lock);
 }
@@ -336,7 +334,7 @@ static void gb_gpio_irq_bus_lock(struct irq_data *d)
 static void gb_gpio_irq_bus_sync_unlock(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
if (line->irq_type_pending) {
@@ -405,21 +403,21 @@ static int gb_gpio_request_handler(struct gb_operation 
*op)
 
 static int gb_gpio_request(struct gpio_chip *chip, unsigned int offset)
 {
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
return gb_gpio_activate_operation(ggc, (u8)offset);
 }
 
 static void gb_gpio_free(struct gpio_chip *chip, unsigned int offset)
 {
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
gb_gpio_deactivate_operation(ggc, (u8)offset);
 }
 
 static int gb_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
 {
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
u8 which;
int ret;
 
@@ -433,7 +431,7 @@ static int gb_gpio_get_direction(struct gpio_chip *chip, 
unsigned int offset)
 
 static int gb_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
 {
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
return gb_gpio_direction_in_operation(ggc, (u8)offset);
 }
@@ -441,14 +439,14 @@ static int gb_gpio_direction_input(struct gpio_chip 
*chip, unsigned int offset)
 static int gb_gpio_direction_output(struct gpio_chip *chip, unsigned int 
offset,
int value)
 {
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
return gb_gpio_direction_out_operation(ggc, (u8)offset, !!value);
 }
 
 static int gb_gpio_get(struct gpio_chip *chip, unsigned int offset)
 {
-   struct gb_gpio_controller *ggc = gpio_

Re: [PATCH v3 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2018-12-22 Thread Nishad Kamdar
On Tue, Dec 18, 2018 at 12:50:56PM +0100, Johan Hovold wrote:
> On Thu, Nov 22, 2018 at 10:39:24PM +0530, Nishad Kamdar wrote:
> > Use the gpiod interface instead of the deprecated
> > old non-descriptor interface.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> > Changes in v2:
> >  - Move comment to the same line as to what it applies to.
> > ---
> >  drivers/staging/greybus/arche-platform.c | 119 ---
> >  1 file changed, 41 insertions(+), 78 deletions(-)
> > 
> > diff --git a/drivers/staging/greybus/arche-platform.c 
> > b/drivers/staging/greybus/arche-platform.c
> > index 4c36e88766e7..a5cea79d8e32 100644
> > --- a/drivers/staging/greybus/arche-platform.c
> > +++ b/drivers/staging/greybus/arche-platform.c
> > @@ -8,10 +8,9 @@
> >  
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >  #include 
> >  #include 
> > -#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -45,14 +44,14 @@ enum svc_wakedetect_state {
> >  
> >  struct arche_platform_drvdata {
> > /* Control GPIO signals to and from AP <=> SVC */
> > -   int svc_reset_gpio;
> > +   struct gpio_desc *svc_reset;
> > +   struct gpio_desc *svc_sysboot;
> 
> Why move sysboot? The flag below is about reset (but should eventually
> go away).
> 
Ok, I'll restore its position.

> > bool is_reset_act_hi;
> > -   int svc_sysboot_gpio;
> > -   int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
> > +   struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
> > signals */
> >  
> > enum arche_platform_state state;
> >  
> > -   int svc_refclk_req;
> > +   struct gpio_desc *svc_refclk_req;
> > struct clk *svc_ref_clk;
> >  
> > struct pinctrl *pinctrl;
> > @@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
> > arche_pdata->wake_detect_state = state;
> >  }
> >  
> > -static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
> > +static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
> >  {
> > -   gpio_set_value(gpio, onoff);
> > +   gpiod_set_value(gpio, onoff);
> >  }
> >  
> >  static int apb_cold_boot(struct device *dev, void *data)
> > @@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
> >  static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
> > *arche_pdata)
> >  {
> > /* Enable interrupt here, to read event back from SVC */
> > -   gpio_direction_input(arche_pdata->wake_detect_gpio);
> > enable_irq(arche_pdata->wake_detect_irq);
> >  }
> >  
> > @@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
> > *devid)
> >  
> > spin_lock_irqsave(_pdata->wake_lock, flags);
> >  
> > -   if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
> > +   if (gpiod_get_value(arche_pdata->wake_detect)) {
> > /* wake/detect rising */
> >  
> > /*
> > @@ -224,10 +222,10 @@ arche_platform_coldboot_seq(struct 
> > arche_platform_drvdata *arche_pdata)
> >  
> > dev_info(arche_pdata->dev, "Booting from cold boot state\n");
> >  
> > -   svc_reset_onoff(arche_pdata->svc_reset_gpio,
> > +   svc_reset_onoff(arche_pdata->svc_reset,
> 
> No need to break line here.
> 
Ok.

> > arche_pdata->is_reset_act_hi);
> >  
> > -   gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
> > +   gpiod_set_value(arche_pdata->svc_sysboot, 0);
> > usleep_range(100, 200);
> >  
> > ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
> > @@ -238,7 +236,7 @@ arche_platform_coldboot_seq(struct 
> > arche_platform_drvdata *arche_pdata)
> > }
> >  
> > /* bring SVC out of reset */
> > -   svc_reset_onoff(arche_pdata->svc_reset_gpio,
> > +   svc_reset_onoff(arche_pdata->svc_reset,
> 
> Same here. Please check throughout.
> 
Yes.

> > !arche_pdata->is_reset_act_hi);
> >  
> > arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
> > @@ -259,10 +257,10 @@ arche_platform_fw_flashing_seq(struct 
> > arche_platform_drvdata *arche_pdata)
> >  
> > dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
> >  
> > -   svc_reset_onoff(arche_pdata->svc_reset_gpio,
> > +   svc_reset_onoff(arche_pdata->svc_reset,
> &g

Re: [PATCH v3 1/3] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP

2018-12-22 Thread Nishad Kamdar
On Tue, Dec 18, 2018 at 12:10:34PM +0100, Johan Hovold wrote:
> On Thu, Nov 22, 2018 at 10:37:16PM +0530, Nishad Kamdar wrote:
> > Convert the GPIO driver to use the GPIO irqchip library
> > GPIOLIB_IRQCHIP instead of reimplementing the same.
> > 
> > Signed-off-by: Nishad Kamdar 
> > ---
> > Changes in v2:
> >  - Retained irq.h and irqdomain.h headers.
> >  - Dropped function gb_gpio_irqchip_add() and
> >called gpiochip_irqchip_add() from probe().
> >  - Referred 
> > https://lkml.kernel.org/r/1476054589-28422-1-git-send-email-linus.wall...@linaro.org.
> 
> Thanks for the update, and sorry about the late review. This looks
> mostly good now, except for a couple minor things pointed out below.
> 
> You also included the conversion to gpiochip_get_data() (as Linus also
> did in his patch) although that's really a separate change and should go
> in its own patch. Please break that bit out in a follow-up patch.
> 
> Also note that someone did a bunch random white space changes to this
> file in the staging tree, so it will not apply cleanly any more.
> 
> > ---
> >  drivers/staging/greybus/Kconfig |   1 +
> >  drivers/staging/greybus/gpio.c  | 184 
> >  2 files changed, 24 insertions(+), 161 deletions(-)
> > 
> > diff --git a/drivers/staging/greybus/Kconfig 
> > b/drivers/staging/greybus/Kconfig
> > index ab096bcef98c..b571e4e8060b 100644
> > --- a/drivers/staging/greybus/Kconfig
> > +++ b/drivers/staging/greybus/Kconfig
> > @@ -148,6 +148,7 @@ if GREYBUS_BRIDGED_PHY
> >  config GREYBUS_GPIO
> > tristate "Greybus GPIO Bridged PHY driver"
> > depends on GPIOLIB
> > +   select GPIOLIB_IRQCHIP
> > ---help---
> >   Select this option if you have a device that follows the
> >   Greybus GPIO Bridged PHY Class specification.
> > diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
> > index b1d4698019a1..2ec54744171d 100644
> > --- a/drivers/staging/greybus/gpio.c
> > +++ b/drivers/staging/greybus/gpio.c
> > @@ -9,9 +9,9 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  
> >  #include "greybus.h"
> > @@ -39,15 +39,8 @@ struct gb_gpio_controller {
> >  
> > struct gpio_chipchip;
> > struct irq_chip irqc;
> 
> Turns out struct gpio_chip will have an irqchip whenever
> CONFIG_GPIOLIB_IRQCHIP is selected so you can drop this one too.
> 
Ok, I'll do that.
> > -   struct irq_chip *irqchip;
> > -   struct irq_domain   *irqdomain;
> > -   unsigned intirq_base;
> > -   irq_flow_handler_t  irq_handler;
> > -   unsigned intirq_default_type;
> > struct mutexirq_lock;
> >  };
> > -#define gpio_chip_to_gb_gpio_controller(chip) \
> > -   container_of(chip, struct gb_gpio_controller, chip)
> >  #define irq_data_to_gpio_chip(d) (d->domain->host_data)
> >  
> >  static int gb_gpio_line_count_operation(struct gb_gpio_controller *ggc)
> > @@ -276,7 +269,7 @@ static void _gb_gpio_irq_set_type(struct 
> > gb_gpio_controller *ggc,
> >  static void gb_gpio_irq_mask(struct irq_data *d)
> >  {
> > struct gpio_chip *chip = irq_data_to_gpio_chip(d);
> > -   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
> > +   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
> 
> So please split these changes into a separate patch as they are not
> related to the irqchip changes.
> 
> Oh, and don't forget to update the TODO file now that the conversion is
> done. :)
> 
Sure, I'll do that.

Thanks for the review.
regards,
Nishad

> Thanks,
> Johan


[PATCH v4 0/4] greybus: gpio: Switch to the gpio descriptor interface

2018-12-22 Thread Nishad Kamdar
This patch series converts uses of the old GPIO API to the GPIO
descriptor API. It also converts the GPIO driver to use the
GPIO irqchip library GPIOLIB_IRQCHIP instead of repimplementing
the same.

Changes in v4:
 - Changes mentioned in individual patches of the set.
Changes in v3:
 - Combines the latest versions of the three greybus patches together
   in a patch series.

Nishad Kamdar (4):
  staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP
  staging: greybus: gpio: Use gpiochip_get_data() in place of
gpio_chip_to_gb_gpio_controller()
  staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor
interface
  staging: greybus: arche-platform: Switch to the gpio descriptor
interface

 drivers/staging/greybus/Kconfig  |   1 +
 drivers/staging/greybus/TODO |   2 -
 drivers/staging/greybus/arche-apb-ctrl.c | 154 ---
 drivers/staging/greybus/arche-platform.c | 124 +--
 drivers/staging/greybus/gpio.c   | 187 +++
 5 files changed, 129 insertions(+), 339 deletions(-)

-- 
2.17.1



[PATCH v4 3/4] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2018-12-22 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface.

Signed-off-by: Nishad Kamdar 
---
Changes in v4:
 - Use gpiod_set_raw_value() for deassert_reset() and
   assert_reset() as gpiod_set_value() will change the
   sematics of these calls by taking any gpio flags
   into account.
 - Remove some unnecesssary line breaks.
 - Restore 'spi_en' gpio check in fw_flashing_seq()
   as it is currently optional.
Changes in v3:
 - Add this patch in a patchset.
Changes in v2:
 - Resolved compilation errors.
---
 drivers/staging/greybus/arche-apb-ctrl.c | 154 ++-
 1 file changed, 63 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
b/drivers/staging/greybus/arche-apb-ctrl.c
index be5ffed90bcf..57eecd0dd0a6 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -8,9 +8,8 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
 
 struct arche_apb_ctrl_drvdata {
/* Control GPIO signals to and from AP <=> AP Bridges */
-   int resetn_gpio;
-   int boot_ret_gpio;
-   int pwroff_gpio;
-   int wake_in_gpio;
-   int wake_out_gpio;
-   int pwrdn_gpio;
+   struct gpio_desc *resetn;
+   struct gpio_desc *boot_ret;
+   struct gpio_desc *pwroff;
+   struct gpio_desc *wake_in;
+   struct gpio_desc *wake_out;
+   struct gpio_desc *pwrdn;
 
enum arche_platform_state state;
bool init_disabled;
@@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
struct regulator *vcore;
struct regulator *vio;
 
-   int clk_en_gpio;
+   struct gpio_desc *clk_en;
struct clk *clk;
 
struct pinctrl *pinctrl;
struct pinctrl_state *pin_default;
 
/* V2: SPI Bus control  */
-   int spi_en_gpio;
+   struct gpio_desc *spi_en;
bool spi_en_polarity_high;
 };
 
 /*
  * Note that these low level api's are active high
  */
-static inline void deassert_reset(unsigned int gpio)
+static inline void deassert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 1);
+   gpiod_set_raw_value(gpio, 1);
 }
 
-static inline void assert_reset(unsigned int gpio)
+static inline void assert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 0);
+   gpiod_set_raw_value(gpio, 0);
 }
 
 /*
@@ -75,11 +74,10 @@ static int coldboot_seq(struct platform_device *pdev)
return 0;
 
/* Hold APB in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
 
-   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
-   gpio_is_valid(apb->spi_en_gpio))
-   devm_gpio_free(dev, apb->spi_en_gpio);
+   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
+   devm_gpiod_put(dev, apb->spi_en);
 
/* Enable power to APB */
if (!IS_ERR(apb->vcore)) {
@@ -101,13 +99,13 @@ static int coldboot_seq(struct platform_device *pdev)
apb_bootret_deassert(dev);
 
/* On DB3 clock was not mandatory */
-   if (gpio_is_valid(apb->clk_en_gpio))
-   gpio_set_value(apb->clk_en_gpio, 1);
+   if (apb->clk_en)
+   gpiod_set_value(apb->clk_en, 1);
 
usleep_range(100, 200);
 
/* deassert reset to APB : Active-low signal */
-   deassert_reset(apb->resetn_gpio);
+   deassert_reset(apb->resetn);
 
apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
 
@@ -136,25 +134,25 @@ static int fw_flashing_seq(struct platform_device *pdev)
return ret;
}
 
-   if (gpio_is_valid(apb->spi_en_gpio)) {
+   if (apb->spi_en) {
unsigned long flags;
 
if (apb->spi_en_polarity_high)
-   flags = GPIOF_OUT_INIT_HIGH;
+   flags = GPIOD_OUT_HIGH;
else
-   flags = GPIOF_OUT_INIT_LOW;
+   flags = GPIOD_OUT_LOW;
 
-   ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
-   flags, "apb_spi_en");
-   if (ret) {
-   dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
-   apb->spi_en_gpio);
+   apb->spi_en = devm_gpiod_get(dev, "gb,spi-en-gpio", flags);
+   if (IS_ERR(apb->spi_en)) {
+   ret = PTR_ERR(apb->spi_en);
+   dev_err(dev, "Failed requesting SPI bus en GPIO: %d\n",
+   ret);
return ret;
}
}
 
/* for flashing device should be in reset state */
-   assert_reset(apb->resetn_gpio);
+  

[PATCH v4 4/4] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2018-12-22 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated
old non-descriptor interface.

Signed-off-by: Nishad Kamdar 
---
Changes in v4:
 - Move 'gpio_desc *svc_sysboot' below the reset flag
   as it is more logical to have reset flag below
   reset gpio.
 - Remove a few unnecessary line breaks.
Changes in v3:
 - Add this patch to a patchset.
Changes in v2:
 - Move comment to the same line as to what it applies to.
---
 drivers/staging/greybus/arche-platform.c | 124 ---
 1 file changed, 41 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 4c36e88766e7..b4b101ba96df 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -8,10 +8,9 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,14 +44,14 @@ enum svc_wakedetect_state {
 
 struct arche_platform_drvdata {
/* Control GPIO signals to and from AP <=> SVC */
-   int svc_reset_gpio;
+   struct gpio_desc *svc_reset;
bool is_reset_act_hi;
-   int svc_sysboot_gpio;
-   int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
+   struct gpio_desc *svc_sysboot;
+   struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
signals */
 
enum arche_platform_state state;
 
-   int svc_refclk_req;
+   struct gpio_desc *svc_refclk_req;
struct clk *svc_ref_clk;
 
struct pinctrl *pinctrl;
@@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
arche_pdata->wake_detect_state = state;
 }
 
-static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
+static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
 {
-   gpio_set_value(gpio, onoff);
+   gpiod_set_value(gpio, onoff);
 }
 
 static int apb_cold_boot(struct device *dev, void *data)
@@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
 static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
*arche_pdata)
 {
/* Enable interrupt here, to read event back from SVC */
-   gpio_direction_input(arche_pdata->wake_detect_gpio);
enable_irq(arche_pdata->wake_detect_irq);
 }
 
@@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
*devid)
 
spin_lock_irqsave(_pdata->wake_lock, flags);
 
-   if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
+   if (gpiod_get_value(arche_pdata->wake_detect)) {
/* wake/detect rising */
 
/*
@@ -224,10 +222,9 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
 
dev_info(arche_pdata->dev, "Booting from cold boot state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
+   gpiod_set_value(arche_pdata->svc_sysboot, 0);
usleep_range(100, 200);
 
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
@@ -238,8 +235,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
}
 
/* bring SVC out of reset */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
 
@@ -259,10 +255,9 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
 
dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 1);
+   gpiod_set_value(arche_pdata->svc_sysboot, 1);
 
usleep_range(100, 200);
 
@@ -273,8 +268,7 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
return ret;
}
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   !arche_pdata->is_reset_act_hi);
+   svc_reset_onoff(arche_pdata->svc_reset, !arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHING);
 
@@ -305,8 +299,7 @@ arche_platform_poweroff_seq(struct arche_platform_drvdata 
*arche_pdata)
clk_disable_unprepare(arche_pdata->svc_ref_clk);
 
/* As part of exit, put APB back in reset state */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
-   arche_pdata->is_reset_act_hi);
+   svc_reset_ono

[PATCH v2] staging: mt7621-mmc: Fix incompletely removed #if 0 block in sd.c

2018-12-06 Thread Nishad Kamdar
Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
does not completely remove an #if 0 block in sd.c. This causes the function
msdc_select_clksrc() which was eariler not compiled, to be compiled.
That causes an error - MSDC_CLKSRC_REG is not defined.

This patch completely removes the #if 0 block

Reported-by: NeilBrown 
Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Modify commit message
 - Include Fixes: and Reported-by: tags
---
 drivers/staging/mt7621-mmc/sd.c | 20 
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 7b66f9b0a094..3d918e481bd8 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
spin_unlock(>lock);
 }
 
-static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
-{
-   u32 val;
-
-   BUG_ON(clksrc > 3);
-
-   val = readl(host->base + MSDC_CLKSRC_REG);
-   if (readl(host->base + MSDC_ECO_VER) >= 4) {
-   val &= ~(0x3  << clk_src_bit[host->id]);
-   val |= clksrc << clk_src_bit[host->id];
-   } else {
-   val &= ~0x3; val |= clksrc;
-   }
-   writel(val, host->base + MSDC_CLKSRC_REG);
-
-   host->hclk = hclks[clksrc];
-   host->hw->clk_src = clksrc;
-}
-#endif /* end of --- */
-
 static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
 {
//struct msdc_hw *hw = host->hw;
-- 
2.17.1



[PATCH v2] staging: mt7621-mmc: Fix incompletely removed #if 0 block in sd.c

2018-12-06 Thread Nishad Kamdar
Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
does not completely remove an #if 0 block in sd.c. This causes the function
msdc_select_clksrc() which was eariler not compiled, to be compiled.
That causes an error - MSDC_CLKSRC_REG is not defined.

This patch completely removes the #if 0 block

Reported-by: NeilBrown 
Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Modify commit message
 - Include Fixes: and Reported-by: tags
---
 drivers/staging/mt7621-mmc/sd.c | 20 
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 7b66f9b0a094..3d918e481bd8 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
spin_unlock(>lock);
 }
 
-static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
-{
-   u32 val;
-
-   BUG_ON(clksrc > 3);
-
-   val = readl(host->base + MSDC_CLKSRC_REG);
-   if (readl(host->base + MSDC_ECO_VER) >= 4) {
-   val &= ~(0x3  << clk_src_bit[host->id]);
-   val |= clksrc << clk_src_bit[host->id];
-   } else {
-   val &= ~0x3; val |= clksrc;
-   }
-   writel(val, host->base + MSDC_CLKSRC_REG);
-
-   host->hclk = hclks[clksrc];
-   host->hw->clk_src = clksrc;
-}
-#endif /* end of --- */
-
 static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
 {
//struct msdc_hw *hw = host->hw;
-- 
2.17.1



Re: [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c

2018-12-06 Thread Nishad Kamdar
On Thu, Dec 06, 2018 at 08:08:24AM +1100, NeilBrown wrote:
> On Wed, Dec 05 2018, Nishad Kamdar wrote:
> 
> > The below patch
> > https://lore.kernel.org/patchwork/patch/995533/
> > does not completely remove an #if 0 block in sd.c.
> 
> Standard practice is to identify patches by their commit id.
> In this case you could
>   git log --oneline  drivers/staging/mt7621-mmc/sd.c
> 
> choose the right patch, and copy/paste with a bit of editing, so:
> 
>   Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in
>   sd.c") does not completely 
> 
> I have
> 
>   [alias]
>   cm = !git --no-pager show -s --format=cm
>   fx = !git --no-pager show -s --format=fixes
>   [pretty]
>   fixes = Fixes: %h (\"%s\")
>   cm = Commit %h (\"%s\")
> 
> in my $HOME/.gitconfig so I can get the text with, e.g.,
> 
>   $ git cm 2a54e3259e2a
>   Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
> 
> Then as that commit introduced a problem, it is best-practice to also do
> 
>   $ git fx 2a54e3259e2a
>   Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
> 
> and add the "Fixes" near the Signed-off-by line.
> 
> Thanks,
> NeilBrown
> 
> 
Ok. I'll do that and resubmit.

Thanks for the review and guidance.

Regards,
Nishad

> > This causes the function msdc_select_clksrc()
> > which was earler not compiled, to be compiled.
> > That causes an error - MSDC_CLKSRC_REG is not
> > defined.
> >
> > This patch completely removes the #if 0 block
> >
> > Signed-off-by: Nishad Kamdar 
> > ---
> >  drivers/staging/mt7621-mmc/sd.c | 20 
> >  1 file changed, 20 deletions(-)
> >
> > diff --git a/drivers/staging/mt7621-mmc/sd.c 
> > b/drivers/staging/mt7621-mmc/sd.c
> > index 7b66f9b0a094..3d918e481bd8 100644
> > --- a/drivers/staging/mt7621-mmc/sd.c
> > +++ b/drivers/staging/mt7621-mmc/sd.c
> > @@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
> > spin_unlock(>lock);
> >  }
> >  
> > -static void msdc_select_clksrc(struct msdc_host *host, unsigned char 
> > clksrc)
> > -{
> > -   u32 val;
> > -
> > -   BUG_ON(clksrc > 3);
> > -
> > -   val = readl(host->base + MSDC_CLKSRC_REG);
> > -   if (readl(host->base + MSDC_ECO_VER) >= 4) {
> > -   val &= ~(0x3  << clk_src_bit[host->id]);
> > -   val |= clksrc << clk_src_bit[host->id];
> > -   } else {
> > -   val &= ~0x3; val |= clksrc;
> > -   }
> > -   writel(val, host->base + MSDC_CLKSRC_REG);
> > -
> > -   host->hclk = hclks[clksrc];
> > -   host->hw->clk_src = clksrc;
> > -}
> > -#endif /* end of --- */
> > -
> >  static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
> >  {
> > //struct msdc_hw *hw = host->hw;
> > -- 
> > 2.17.1




Re: [PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c

2018-12-06 Thread Nishad Kamdar
On Thu, Dec 06, 2018 at 08:08:24AM +1100, NeilBrown wrote:
> On Wed, Dec 05 2018, Nishad Kamdar wrote:
> 
> > The below patch
> > https://lore.kernel.org/patchwork/patch/995533/
> > does not completely remove an #if 0 block in sd.c.
> 
> Standard practice is to identify patches by their commit id.
> In this case you could
>   git log --oneline  drivers/staging/mt7621-mmc/sd.c
> 
> choose the right patch, and copy/paste with a bit of editing, so:
> 
>   Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in
>   sd.c") does not completely 
> 
> I have
> 
>   [alias]
>   cm = !git --no-pager show -s --format=cm
>   fx = !git --no-pager show -s --format=fixes
>   [pretty]
>   fixes = Fixes: %h (\"%s\")
>   cm = Commit %h (\"%s\")
> 
> in my $HOME/.gitconfig so I can get the text with, e.g.,
> 
>   $ git cm 2a54e3259e2a
>   Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
> 
> Then as that commit introduced a problem, it is best-practice to also do
> 
>   $ git fx 2a54e3259e2a
>   Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c")
> 
> and add the "Fixes" near the Signed-off-by line.
> 
> Thanks,
> NeilBrown
> 
> 
Ok. I'll do that and resubmit.

Thanks for the review and guidance.

Regards,
Nishad

> > This causes the function msdc_select_clksrc()
> > which was earler not compiled, to be compiled.
> > That causes an error - MSDC_CLKSRC_REG is not
> > defined.
> >
> > This patch completely removes the #if 0 block
> >
> > Signed-off-by: Nishad Kamdar 
> > ---
> >  drivers/staging/mt7621-mmc/sd.c | 20 
> >  1 file changed, 20 deletions(-)
> >
> > diff --git a/drivers/staging/mt7621-mmc/sd.c 
> > b/drivers/staging/mt7621-mmc/sd.c
> > index 7b66f9b0a094..3d918e481bd8 100644
> > --- a/drivers/staging/mt7621-mmc/sd.c
> > +++ b/drivers/staging/mt7621-mmc/sd.c
> > @@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
> > spin_unlock(>lock);
> >  }
> >  
> > -static void msdc_select_clksrc(struct msdc_host *host, unsigned char 
> > clksrc)
> > -{
> > -   u32 val;
> > -
> > -   BUG_ON(clksrc > 3);
> > -
> > -   val = readl(host->base + MSDC_CLKSRC_REG);
> > -   if (readl(host->base + MSDC_ECO_VER) >= 4) {
> > -   val &= ~(0x3  << clk_src_bit[host->id]);
> > -   val |= clksrc << clk_src_bit[host->id];
> > -   } else {
> > -   val &= ~0x3; val |= clksrc;
> > -   }
> > -   writel(val, host->base + MSDC_CLKSRC_REG);
> > -
> > -   host->hclk = hclks[clksrc];
> > -   host->hw->clk_src = clksrc;
> > -}
> > -#endif /* end of --- */
> > -
> >  static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
> >  {
> > //struct msdc_hw *hw = host->hw;
> > -- 
> > 2.17.1




Re: [PATCH v6 1/3] staging: mt7621-mmc: Remove #if 0 blocks in sd.c

2018-12-05 Thread Nishad Kamdar
On Sun, Nov 18, 2018 at 08:33:03AM +1100, NeilBrown wrote:
> On Thu, Oct 04 2018, Nishad Kamdar wrote:
> 
> > This patch removes #if 0 code blocks and usages of
> > functions defined in the #if 0 blocks in sd.c.
> >
> > Signed-off-by: Nishad Kamdar 
> 
> Hi Nishad,
>  thanks for this patch (and others) and apologies for not
>  reviewing/testing it earlier.
>  Unfortunately there is a problem - see below.
>  
> >  
> > -#if 0 /* --- by chhung */
> > -/* For E2 only */
> > -static u8 clk_src_bit[4] = {
> > -   0, 3, 5, 7
> > -};
> > -
> >  static void msdc_select_clksrc(struct msdc_host *host, unsigned char 
> > clksrc)
> >  {
> > u32 val;
> 
> Above you removed the first few lines of a "#if 0" block, but not all of
> it.  Previously the function msdc_select_clksrc() was not compiled at
> all.  Now it is, and that causes an error - MSDC_CLKSRC_REG is not
> defined.
> 
> Would you be able to send a follow-patch patch which removes this
> function and the "#endif /* end of --- */" at the end?
> 
> Thanks,
> NeilBrown

Sure, I'll send the updated patch.

Thanks for the review.

Regards,
Nishad


Re: [PATCH v6 1/3] staging: mt7621-mmc: Remove #if 0 blocks in sd.c

2018-12-05 Thread Nishad Kamdar
On Sun, Nov 18, 2018 at 08:33:03AM +1100, NeilBrown wrote:
> On Thu, Oct 04 2018, Nishad Kamdar wrote:
> 
> > This patch removes #if 0 code blocks and usages of
> > functions defined in the #if 0 blocks in sd.c.
> >
> > Signed-off-by: Nishad Kamdar 
> 
> Hi Nishad,
>  thanks for this patch (and others) and apologies for not
>  reviewing/testing it earlier.
>  Unfortunately there is a problem - see below.
>  
> >  
> > -#if 0 /* --- by chhung */
> > -/* For E2 only */
> > -static u8 clk_src_bit[4] = {
> > -   0, 3, 5, 7
> > -};
> > -
> >  static void msdc_select_clksrc(struct msdc_host *host, unsigned char 
> > clksrc)
> >  {
> > u32 val;
> 
> Above you removed the first few lines of a "#if 0" block, but not all of
> it.  Previously the function msdc_select_clksrc() was not compiled at
> all.  Now it is, and that causes an error - MSDC_CLKSRC_REG is not
> defined.
> 
> Would you be able to send a follow-patch patch which removes this
> function and the "#endif /* end of --- */" at the end?
> 
> Thanks,
> NeilBrown

Sure, I'll send the updated patch.

Thanks for the review.

Regards,
Nishad


[PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c

2018-12-05 Thread Nishad Kamdar
The below patch
https://lore.kernel.org/patchwork/patch/995533/
does not completely remove an #if 0 block in sd.c.
This causes the function msdc_select_clksrc()
which was earler not compiled, to be compiled.
That causes an error - MSDC_CLKSRC_REG is not
defined.

This patch completely removes the #if 0 block

Signed-off-by: Nishad Kamdar 
---
 drivers/staging/mt7621-mmc/sd.c | 20 
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 7b66f9b0a094..3d918e481bd8 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
spin_unlock(>lock);
 }
 
-static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
-{
-   u32 val;
-
-   BUG_ON(clksrc > 3);
-
-   val = readl(host->base + MSDC_CLKSRC_REG);
-   if (readl(host->base + MSDC_ECO_VER) >= 4) {
-   val &= ~(0x3  << clk_src_bit[host->id]);
-   val |= clksrc << clk_src_bit[host->id];
-   } else {
-   val &= ~0x3; val |= clksrc;
-   }
-   writel(val, host->base + MSDC_CLKSRC_REG);
-
-   host->hclk = hclks[clksrc];
-   host->hw->clk_src = clksrc;
-}
-#endif /* end of --- */
-
 static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
 {
//struct msdc_hw *hw = host->hw;
-- 
2.17.1



[PATCH] staging: mt7621-mmc: Remove missed lines of the #if 0 block in sd.c

2018-12-05 Thread Nishad Kamdar
The below patch
https://lore.kernel.org/patchwork/patch/995533/
does not completely remove an #if 0 block in sd.c.
This causes the function msdc_select_clksrc()
which was earler not compiled, to be compiled.
That causes an error - MSDC_CLKSRC_REG is not
defined.

This patch completely removes the #if 0 block

Signed-off-by: Nishad Kamdar 
---
 drivers/staging/mt7621-mmc/sd.c | 20 
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
index 7b66f9b0a094..3d918e481bd8 100644
--- a/drivers/staging/mt7621-mmc/sd.c
+++ b/drivers/staging/mt7621-mmc/sd.c
@@ -216,26 +216,6 @@ static void msdc_tasklet_card(struct work_struct *work)
spin_unlock(>lock);
 }
 
-static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc)
-{
-   u32 val;
-
-   BUG_ON(clksrc > 3);
-
-   val = readl(host->base + MSDC_CLKSRC_REG);
-   if (readl(host->base + MSDC_ECO_VER) >= 4) {
-   val &= ~(0x3  << clk_src_bit[host->id]);
-   val |= clksrc << clk_src_bit[host->id];
-   } else {
-   val &= ~0x3; val |= clksrc;
-   }
-   writel(val, host->base + MSDC_CLKSRC_REG);
-
-   host->hclk = hclks[clksrc];
-   host->hw->clk_src = clksrc;
-}
-#endif /* end of --- */
-
 static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz)
 {
//struct msdc_hw *hw = host->hw;
-- 
2.17.1



[PATCH v3 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated
old non-descriptor interface.

Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Move comment to the same line as to what it applies to.
---
 drivers/staging/greybus/arche-platform.c | 119 ---
 1 file changed, 41 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 4c36e88766e7..a5cea79d8e32 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -8,10 +8,9 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,14 +44,14 @@ enum svc_wakedetect_state {
 
 struct arche_platform_drvdata {
/* Control GPIO signals to and from AP <=> SVC */
-   int svc_reset_gpio;
+   struct gpio_desc *svc_reset;
+   struct gpio_desc *svc_sysboot;
bool is_reset_act_hi;
-   int svc_sysboot_gpio;
-   int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
+   struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
signals */
 
enum arche_platform_state state;
 
-   int svc_refclk_req;
+   struct gpio_desc *svc_refclk_req;
struct clk *svc_ref_clk;
 
struct pinctrl *pinctrl;
@@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
arche_pdata->wake_detect_state = state;
 }
 
-static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
+static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
 {
-   gpio_set_value(gpio, onoff);
+   gpiod_set_value(gpio, onoff);
 }
 
 static int apb_cold_boot(struct device *dev, void *data)
@@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
 static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
*arche_pdata)
 {
/* Enable interrupt here, to read event back from SVC */
-   gpio_direction_input(arche_pdata->wake_detect_gpio);
enable_irq(arche_pdata->wake_detect_irq);
 }
 
@@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
*devid)
 
spin_lock_irqsave(_pdata->wake_lock, flags);
 
-   if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
+   if (gpiod_get_value(arche_pdata->wake_detect)) {
/* wake/detect rising */
 
/*
@@ -224,10 +222,10 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
 
dev_info(arche_pdata->dev, "Booting from cold boot state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
+   gpiod_set_value(arche_pdata->svc_sysboot, 0);
usleep_range(100, 200);
 
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
@@ -238,7 +236,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
}
 
/* bring SVC out of reset */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
!arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
@@ -259,10 +257,10 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
 
dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 1);
+   gpiod_set_value(arche_pdata->svc_sysboot, 1);
 
usleep_range(100, 200);
 
@@ -273,7 +271,7 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
return ret;
}
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
!arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHING);
@@ -305,7 +303,7 @@ arche_platform_poweroff_seq(struct arche_platform_drvdata 
*arche_pdata)
clk_disable_unprepare(arche_pdata->svc_ref_clk);
 
/* As part of exit, put APB back in reset state */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_OFF);
@@ -435,6 +433,7 @@ static int arche_platform_probe(struct platform_device 
*pdev)
struct device *dev = >dev;
struct device_node *np = dev->of_node;
int ret;
+   unsigned int flags;
 
arche_pdata = devm_kzalloc(>dev, 

[PATCH v3 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated
old non-descriptor interface.

Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Move comment to the same line as to what it applies to.
---
 drivers/staging/greybus/arche-platform.c | 119 ---
 1 file changed, 41 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 4c36e88766e7..a5cea79d8e32 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -8,10 +8,9 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -45,14 +44,14 @@ enum svc_wakedetect_state {
 
 struct arche_platform_drvdata {
/* Control GPIO signals to and from AP <=> SVC */
-   int svc_reset_gpio;
+   struct gpio_desc *svc_reset;
+   struct gpio_desc *svc_sysboot;
bool is_reset_act_hi;
-   int svc_sysboot_gpio;
-   int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
+   struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
signals */
 
enum arche_platform_state state;
 
-   int svc_refclk_req;
+   struct gpio_desc *svc_refclk_req;
struct clk *svc_ref_clk;
 
struct pinctrl *pinctrl;
@@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
arche_pdata->wake_detect_state = state;
 }
 
-static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
+static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
 {
-   gpio_set_value(gpio, onoff);
+   gpiod_set_value(gpio, onoff);
 }
 
 static int apb_cold_boot(struct device *dev, void *data)
@@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
 static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
*arche_pdata)
 {
/* Enable interrupt here, to read event back from SVC */
-   gpio_direction_input(arche_pdata->wake_detect_gpio);
enable_irq(arche_pdata->wake_detect_irq);
 }
 
@@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
*devid)
 
spin_lock_irqsave(_pdata->wake_lock, flags);
 
-   if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
+   if (gpiod_get_value(arche_pdata->wake_detect)) {
/* wake/detect rising */
 
/*
@@ -224,10 +222,10 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
 
dev_info(arche_pdata->dev, "Booting from cold boot state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
+   gpiod_set_value(arche_pdata->svc_sysboot, 0);
usleep_range(100, 200);
 
ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
@@ -238,7 +236,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
*arche_pdata)
}
 
/* bring SVC out of reset */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
!arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
@@ -259,10 +257,10 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
 
dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
arche_pdata->is_reset_act_hi);
 
-   gpio_set_value(arche_pdata->svc_sysboot_gpio, 1);
+   gpiod_set_value(arche_pdata->svc_sysboot, 1);
 
usleep_range(100, 200);
 
@@ -273,7 +271,7 @@ arche_platform_fw_flashing_seq(struct 
arche_platform_drvdata *arche_pdata)
return ret;
}
 
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
!arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHING);
@@ -305,7 +303,7 @@ arche_platform_poweroff_seq(struct arche_platform_drvdata 
*arche_pdata)
clk_disable_unprepare(arche_pdata->svc_ref_clk);
 
/* As part of exit, put APB back in reset state */
-   svc_reset_onoff(arche_pdata->svc_reset_gpio,
+   svc_reset_onoff(arche_pdata->svc_reset,
arche_pdata->is_reset_act_hi);
 
arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_OFF);
@@ -435,6 +433,7 @@ static int arche_platform_probe(struct platform_device 
*pdev)
struct device *dev = >dev;
struct device_node *np = dev->of_node;
int ret;
+   unsigned int flags;
 
arche_pdata = devm_kzalloc(>dev, 

[PATCH v3 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface.

Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Resolved compilation errors.
---
 drivers/staging/greybus/arche-apb-ctrl.c | 159 +--
 1 file changed, 65 insertions(+), 94 deletions(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
b/drivers/staging/greybus/arche-apb-ctrl.c
index be5ffed90bcf..e887f6aee20b 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -8,9 +8,8 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
 
 struct arche_apb_ctrl_drvdata {
/* Control GPIO signals to and from AP <=> AP Bridges */
-   int resetn_gpio;
-   int boot_ret_gpio;
-   int pwroff_gpio;
-   int wake_in_gpio;
-   int wake_out_gpio;
-   int pwrdn_gpio;
+   struct gpio_desc *resetn;
+   struct gpio_desc *boot_ret;
+   struct gpio_desc *pwroff;
+   struct gpio_desc *wake_in;
+   struct gpio_desc *wake_out;
+   struct gpio_desc *pwrdn;
 
enum arche_platform_state state;
bool init_disabled;
@@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
struct regulator *vcore;
struct regulator *vio;
 
-   int clk_en_gpio;
+   struct gpio_desc *clk_en;
struct clk *clk;
 
struct pinctrl *pinctrl;
struct pinctrl_state *pin_default;
 
/* V2: SPI Bus control  */
-   int spi_en_gpio;
+   struct gpio_desc *spi_en;
bool spi_en_polarity_high;
 };
 
 /*
  * Note that these low level api's are active high
  */
-static inline void deassert_reset(unsigned int gpio)
+static inline void deassert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 1);
+   gpiod_set_value(gpio, 1);
 }
 
-static inline void assert_reset(unsigned int gpio)
+static inline void assert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 0);
+   gpiod_set_value(gpio, 0);
 }
 
 /*
@@ -75,11 +74,11 @@ static int coldboot_seq(struct platform_device *pdev)
return 0;
 
/* Hold APB in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
 
if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
-   gpio_is_valid(apb->spi_en_gpio))
-   devm_gpio_free(dev, apb->spi_en_gpio);
+   apb->spi_en)
+   devm_gpiod_put(dev, apb->spi_en);
 
/* Enable power to APB */
if (!IS_ERR(apb->vcore)) {
@@ -101,13 +100,13 @@ static int coldboot_seq(struct platform_device *pdev)
apb_bootret_deassert(dev);
 
/* On DB3 clock was not mandatory */
-   if (gpio_is_valid(apb->clk_en_gpio))
-   gpio_set_value(apb->clk_en_gpio, 1);
+   if (apb->clk_en)
+   gpiod_set_value(apb->clk_en, 1);
 
usleep_range(100, 200);
 
/* deassert reset to APB : Active-low signal */
-   deassert_reset(apb->resetn_gpio);
+   deassert_reset(apb->resetn);
 
apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
 
@@ -119,6 +118,7 @@ static int fw_flashing_seq(struct platform_device *pdev)
struct device *dev = >dev;
struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
int ret;
+   unsigned long flags;
 
if (apb->init_disabled ||
apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
@@ -136,25 +136,20 @@ static int fw_flashing_seq(struct platform_device *pdev)
return ret;
}
 
-   if (gpio_is_valid(apb->spi_en_gpio)) {
-   unsigned long flags;
+   if (apb->spi_en_polarity_high)
+   flags = GPIOD_OUT_HIGH;
+   else
+   flags = GPIOD_OUT_LOW;
 
-   if (apb->spi_en_polarity_high)
-   flags = GPIOF_OUT_INIT_HIGH;
-   else
-   flags = GPIOF_OUT_INIT_LOW;
-
-   ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
-   flags, "apb_spi_en");
-   if (ret) {
-   dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
-   apb->spi_en_gpio);
-   return ret;
-   }
+   apb->spi_en = devm_gpiod_get(dev, "gb,spi-en-gpio", flags);
+   if (IS_ERR(apb->spi_en)) {
+   ret = PTR_ERR(apb->spi_en);
+   dev_err(dev, "Failed requesting SPI bus en GPIO: %d\n", ret);
+   return ret;
}
 
/* for flashing device should be in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
apb->state = ARCHE_PLATFORM_STATE_FW_FLASHING;
 
 

[PATCH v3 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
Use the gpiod interface instead of the deprecated old non-descriptor
interface.

Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Resolved compilation errors.
---
 drivers/staging/greybus/arche-apb-ctrl.c | 159 +--
 1 file changed, 65 insertions(+), 94 deletions(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
b/drivers/staging/greybus/arche-apb-ctrl.c
index be5ffed90bcf..e887f6aee20b 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -8,9 +8,8 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
 
 struct arche_apb_ctrl_drvdata {
/* Control GPIO signals to and from AP <=> AP Bridges */
-   int resetn_gpio;
-   int boot_ret_gpio;
-   int pwroff_gpio;
-   int wake_in_gpio;
-   int wake_out_gpio;
-   int pwrdn_gpio;
+   struct gpio_desc *resetn;
+   struct gpio_desc *boot_ret;
+   struct gpio_desc *pwroff;
+   struct gpio_desc *wake_in;
+   struct gpio_desc *wake_out;
+   struct gpio_desc *pwrdn;
 
enum arche_platform_state state;
bool init_disabled;
@@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
struct regulator *vcore;
struct regulator *vio;
 
-   int clk_en_gpio;
+   struct gpio_desc *clk_en;
struct clk *clk;
 
struct pinctrl *pinctrl;
struct pinctrl_state *pin_default;
 
/* V2: SPI Bus control  */
-   int spi_en_gpio;
+   struct gpio_desc *spi_en;
bool spi_en_polarity_high;
 };
 
 /*
  * Note that these low level api's are active high
  */
-static inline void deassert_reset(unsigned int gpio)
+static inline void deassert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 1);
+   gpiod_set_value(gpio, 1);
 }
 
-static inline void assert_reset(unsigned int gpio)
+static inline void assert_reset(struct gpio_desc *gpio)
 {
-   gpio_set_value(gpio, 0);
+   gpiod_set_value(gpio, 0);
 }
 
 /*
@@ -75,11 +74,11 @@ static int coldboot_seq(struct platform_device *pdev)
return 0;
 
/* Hold APB in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
 
if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
-   gpio_is_valid(apb->spi_en_gpio))
-   devm_gpio_free(dev, apb->spi_en_gpio);
+   apb->spi_en)
+   devm_gpiod_put(dev, apb->spi_en);
 
/* Enable power to APB */
if (!IS_ERR(apb->vcore)) {
@@ -101,13 +100,13 @@ static int coldboot_seq(struct platform_device *pdev)
apb_bootret_deassert(dev);
 
/* On DB3 clock was not mandatory */
-   if (gpio_is_valid(apb->clk_en_gpio))
-   gpio_set_value(apb->clk_en_gpio, 1);
+   if (apb->clk_en)
+   gpiod_set_value(apb->clk_en, 1);
 
usleep_range(100, 200);
 
/* deassert reset to APB : Active-low signal */
-   deassert_reset(apb->resetn_gpio);
+   deassert_reset(apb->resetn);
 
apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
 
@@ -119,6 +118,7 @@ static int fw_flashing_seq(struct platform_device *pdev)
struct device *dev = >dev;
struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
int ret;
+   unsigned long flags;
 
if (apb->init_disabled ||
apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
@@ -136,25 +136,20 @@ static int fw_flashing_seq(struct platform_device *pdev)
return ret;
}
 
-   if (gpio_is_valid(apb->spi_en_gpio)) {
-   unsigned long flags;
+   if (apb->spi_en_polarity_high)
+   flags = GPIOD_OUT_HIGH;
+   else
+   flags = GPIOD_OUT_LOW;
 
-   if (apb->spi_en_polarity_high)
-   flags = GPIOF_OUT_INIT_HIGH;
-   else
-   flags = GPIOF_OUT_INIT_LOW;
-
-   ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
-   flags, "apb_spi_en");
-   if (ret) {
-   dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
-   apb->spi_en_gpio);
-   return ret;
-   }
+   apb->spi_en = devm_gpiod_get(dev, "gb,spi-en-gpio", flags);
+   if (IS_ERR(apb->spi_en)) {
+   ret = PTR_ERR(apb->spi_en);
+   dev_err(dev, "Failed requesting SPI bus en GPIO: %d\n", ret);
+   return ret;
}
 
/* for flashing device should be in reset state */
-   assert_reset(apb->resetn_gpio);
+   assert_reset(apb->resetn);
apb->state = ARCHE_PLATFORM_STATE_FW_FLASHING;
 
 

[PATCH v3 1/3] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP

2018-11-22 Thread Nishad Kamdar
Convert the GPIO driver to use the GPIO irqchip library
GPIOLIB_IRQCHIP instead of reimplementing the same.

Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Retained irq.h and irqdomain.h headers.
 - Dropped function gb_gpio_irqchip_add() and
   called gpiochip_irqchip_add() from probe().
 - Referred 
https://lkml.kernel.org/r/1476054589-28422-1-git-send-email-linus.wall...@linaro.org.
---
 drivers/staging/greybus/Kconfig |   1 +
 drivers/staging/greybus/gpio.c  | 184 
 2 files changed, 24 insertions(+), 161 deletions(-)

diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index ab096bcef98c..b571e4e8060b 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -148,6 +148,7 @@ if GREYBUS_BRIDGED_PHY
 config GREYBUS_GPIO
tristate "Greybus GPIO Bridged PHY driver"
depends on GPIOLIB
+   select GPIOLIB_IRQCHIP
---help---
  Select this option if you have a device that follows the
  Greybus GPIO Bridged PHY Class specification.
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index b1d4698019a1..2ec54744171d 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -9,9 +9,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 
 #include "greybus.h"
@@ -39,15 +39,8 @@ struct gb_gpio_controller {
 
struct gpio_chipchip;
struct irq_chip irqc;
-   struct irq_chip *irqchip;
-   struct irq_domain   *irqdomain;
-   unsigned intirq_base;
-   irq_flow_handler_t  irq_handler;
-   unsigned intirq_default_type;
struct mutexirq_lock;
 };
-#define gpio_chip_to_gb_gpio_controller(chip) \
-   container_of(chip, struct gb_gpio_controller, chip)
 #define irq_data_to_gpio_chip(d) (d->domain->host_data)
 
 static int gb_gpio_line_count_operation(struct gb_gpio_controller *ggc)
@@ -276,7 +269,7 @@ static void _gb_gpio_irq_set_type(struct gb_gpio_controller 
*ggc,
 static void gb_gpio_irq_mask(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
line->masked = true;
@@ -286,7 +279,7 @@ static void gb_gpio_irq_mask(struct irq_data *d)
 static void gb_gpio_irq_unmask(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
line->masked = false;
@@ -296,7 +289,7 @@ static void gb_gpio_irq_unmask(struct irq_data *d)
 static int gb_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
struct device *dev = >gbphy_dev->dev;
u8 irq_type;
@@ -334,7 +327,7 @@ static int gb_gpio_irq_set_type(struct irq_data *d, 
unsigned int type)
 static void gb_gpio_irq_bus_lock(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
mutex_lock(>irq_lock);
 }
@@ -342,7 +335,7 @@ static void gb_gpio_irq_bus_lock(struct irq_data *d)
 static void gb_gpio_irq_bus_sync_unlock(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
if (line->irq_type_pending) {
@@ -391,7 +384,7 @@ static int gb_gpio_request_handler(struct gb_operation *op)
return -EINVAL;
}
 
-   irq = irq_find_mapping(ggc->irqdomain, event->which);
+   irq = irq_find_mapping(ggc->chip.irq.domain, event->which);
if (!irq) {
dev_err(dev, "failed to find IRQ\n");
return -EINVAL;
@@ -411,21 +404,21 @@ static int gb_gpio_request_handler(struct gb_operation 
*op)
 
 static int gb_gpio_request(struct gpio_chip *chip, unsigned int offset)
 {
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
return gb_gpio_activate_operation(ggc, (u8)offset);
 }

[PATCH v3 1/3] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP

2018-11-22 Thread Nishad Kamdar
Convert the GPIO driver to use the GPIO irqchip library
GPIOLIB_IRQCHIP instead of reimplementing the same.

Signed-off-by: Nishad Kamdar 
---
Changes in v2:
 - Retained irq.h and irqdomain.h headers.
 - Dropped function gb_gpio_irqchip_add() and
   called gpiochip_irqchip_add() from probe().
 - Referred 
https://lkml.kernel.org/r/1476054589-28422-1-git-send-email-linus.wall...@linaro.org.
---
 drivers/staging/greybus/Kconfig |   1 +
 drivers/staging/greybus/gpio.c  | 184 
 2 files changed, 24 insertions(+), 161 deletions(-)

diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
index ab096bcef98c..b571e4e8060b 100644
--- a/drivers/staging/greybus/Kconfig
+++ b/drivers/staging/greybus/Kconfig
@@ -148,6 +148,7 @@ if GREYBUS_BRIDGED_PHY
 config GREYBUS_GPIO
tristate "Greybus GPIO Bridged PHY driver"
depends on GPIOLIB
+   select GPIOLIB_IRQCHIP
---help---
  Select this option if you have a device that follows the
  Greybus GPIO Bridged PHY Class specification.
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index b1d4698019a1..2ec54744171d 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -9,9 +9,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 
 #include "greybus.h"
@@ -39,15 +39,8 @@ struct gb_gpio_controller {
 
struct gpio_chipchip;
struct irq_chip irqc;
-   struct irq_chip *irqchip;
-   struct irq_domain   *irqdomain;
-   unsigned intirq_base;
-   irq_flow_handler_t  irq_handler;
-   unsigned intirq_default_type;
struct mutexirq_lock;
 };
-#define gpio_chip_to_gb_gpio_controller(chip) \
-   container_of(chip, struct gb_gpio_controller, chip)
 #define irq_data_to_gpio_chip(d) (d->domain->host_data)
 
 static int gb_gpio_line_count_operation(struct gb_gpio_controller *ggc)
@@ -276,7 +269,7 @@ static void _gb_gpio_irq_set_type(struct gb_gpio_controller 
*ggc,
 static void gb_gpio_irq_mask(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
line->masked = true;
@@ -286,7 +279,7 @@ static void gb_gpio_irq_mask(struct irq_data *d)
 static void gb_gpio_irq_unmask(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
line->masked = false;
@@ -296,7 +289,7 @@ static void gb_gpio_irq_unmask(struct irq_data *d)
 static int gb_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
struct device *dev = >gbphy_dev->dev;
u8 irq_type;
@@ -334,7 +327,7 @@ static int gb_gpio_irq_set_type(struct irq_data *d, 
unsigned int type)
 static void gb_gpio_irq_bus_lock(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
mutex_lock(>irq_lock);
 }
@@ -342,7 +335,7 @@ static void gb_gpio_irq_bus_lock(struct irq_data *d)
 static void gb_gpio_irq_bus_sync_unlock(struct irq_data *d)
 {
struct gpio_chip *chip = irq_data_to_gpio_chip(d);
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
struct gb_gpio_line *line = >lines[d->hwirq];
 
if (line->irq_type_pending) {
@@ -391,7 +384,7 @@ static int gb_gpio_request_handler(struct gb_operation *op)
return -EINVAL;
}
 
-   irq = irq_find_mapping(ggc->irqdomain, event->which);
+   irq = irq_find_mapping(ggc->chip.irq.domain, event->which);
if (!irq) {
dev_err(dev, "failed to find IRQ\n");
return -EINVAL;
@@ -411,21 +404,21 @@ static int gb_gpio_request_handler(struct gb_operation 
*op)
 
 static int gb_gpio_request(struct gpio_chip *chip, unsigned int offset)
 {
-   struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
+   struct gb_gpio_controller *ggc = gpiochip_get_data(chip);
 
return gb_gpio_activate_operation(ggc, (u8)offset);
 }

[PATCH v3 0/3] greybus: gpio: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
This patch series converts uses of the old GPIO API to the GPIO
descriptor API. It also converts the GPIO driver to use the
GPIO irqchip library GPIOLIB_IRQCHIP instead of repimplementing
the same.

Changes in v3:
 - Combines the latest versions of the three greybus patches together
   in a patch series.

Nishad Kamdar (3):
  staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP
  staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor
interface
  staging: greybus: arche-platform: Switch to the gpio descriptor
interface

 drivers/staging/greybus/Kconfig  |   1 +
 drivers/staging/greybus/arche-apb-ctrl.c | 159 
 drivers/staging/greybus/arche-platform.c | 119 +--
 drivers/staging/greybus/gpio.c   | 184 +++
 4 files changed, 130 insertions(+), 333 deletions(-)

-- 
2.17.1



[PATCH v3 0/3] greybus: gpio: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
This patch series converts uses of the old GPIO API to the GPIO
descriptor API. It also converts the GPIO driver to use the
GPIO irqchip library GPIOLIB_IRQCHIP instead of repimplementing
the same.

Changes in v3:
 - Combines the latest versions of the three greybus patches together
   in a patch series.

Nishad Kamdar (3):
  staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP
  staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor
interface
  staging: greybus: arche-platform: Switch to the gpio descriptor
interface

 drivers/staging/greybus/Kconfig  |   1 +
 drivers/staging/greybus/arche-apb-ctrl.c | 159 
 drivers/staging/greybus/arche-platform.c | 119 +--
 drivers/staging/greybus/gpio.c   | 184 +++
 4 files changed, 130 insertions(+), 333 deletions(-)

-- 
2.17.1



Re: [PATCH] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
On Tue, Nov 20, 2018 at 10:49:54AM +0100, Greg Kroah-Hartman wrote:
> On Sat, Nov 17, 2018 at 04:40:27PM +0100, Johan Hovold wrote:
> > On Sat, Nov 17, 2018 at 12:41:11PM +0530, Nishad Kamdar wrote:
> > > On Fri, Nov 16, 2018 at 05:06:22PM +0100, Johan Hovold wrote:
> > > > On Fri, Nov 16, 2018 at 08:47:44PM +0530, Nishad Kamdar wrote:
> > > > > Use the gpiod interface instead of the deprecated
> > > > > old non-descriptor interface.
> > > > > 
> > > > > Signed-off-by: Nishad Kamdar 
> > > > > ---
> > > > 
> > > > Always include a change log here after the cut-off line so we know what
> > > > changed since previous versions.
> > > > 
> > > > Also include the patch revision in the Subject (e.g. "[PATCH v3]
> > > > staging: greybus: ...").
> > > > 
> > > 
> > > Ok, but this is the first patch version that I submitted
> > > for greybus: arche-platform.
> > 
> > Ah, sorry. I thought this was an update of the arche-apb-ctrl patch.
> 
> Me too.
> 
> I am totally confused as to what is, and is not, the latest versions of
> all of these patches :(
> 
> Nishad, can you resend all of your pending greybus patches, as a patch
> series, as "v3" so that I know which to properly review?  I've dropped
> all of your others from my review queue now.
> 
> thanks,
> 
> greg k-h

Ok, I'll do that.

Thanks for the review.

Regards,
Nishad


Re: [PATCH] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2018-11-22 Thread Nishad Kamdar
On Tue, Nov 20, 2018 at 10:49:54AM +0100, Greg Kroah-Hartman wrote:
> On Sat, Nov 17, 2018 at 04:40:27PM +0100, Johan Hovold wrote:
> > On Sat, Nov 17, 2018 at 12:41:11PM +0530, Nishad Kamdar wrote:
> > > On Fri, Nov 16, 2018 at 05:06:22PM +0100, Johan Hovold wrote:
> > > > On Fri, Nov 16, 2018 at 08:47:44PM +0530, Nishad Kamdar wrote:
> > > > > Use the gpiod interface instead of the deprecated
> > > > > old non-descriptor interface.
> > > > > 
> > > > > Signed-off-by: Nishad Kamdar 
> > > > > ---
> > > > 
> > > > Always include a change log here after the cut-off line so we know what
> > > > changed since previous versions.
> > > > 
> > > > Also include the patch revision in the Subject (e.g. "[PATCH v3]
> > > > staging: greybus: ...").
> > > > 
> > > 
> > > Ok, but this is the first patch version that I submitted
> > > for greybus: arche-platform.
> > 
> > Ah, sorry. I thought this was an update of the arche-apb-ctrl patch.
> 
> Me too.
> 
> I am totally confused as to what is, and is not, the latest versions of
> all of these patches :(
> 
> Nishad, can you resend all of your pending greybus patches, as a patch
> series, as "v3" so that I know which to properly review?  I've dropped
> all of your others from my review queue now.
> 
> thanks,
> 
> greg k-h

Ok, I'll do that.

Thanks for the review.

Regards,
Nishad


  1   2   3   4   >