Skip to contentSkip to conversation

staging: move greybus core out of staging

PATCH In review Greg Kroah-Hartman 10 participants 35 messages Aug 25, 2019 – Sep 2, 2019

Subsystems (8)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

cover staging: move greybus core out of staging

The Greybus code has long been "stable" but was living in the drivers/staging/ directory to see if there really was going to be devices using this protocol over the long-term. With the success of millions of phones with this hardware and code in it, and the recent Google Summer of Code project, and a number of of new devices in the works from various companies, it is time to finally move this code out of staging into the "real" portion of the kernel so that people know they can rely on it.

This series first does a little bit of checkpatch cleanups for some basic remaining issues in the greybus files, and then moves the include directory, the greybus core code, and the es2 greybus host controller driver into drivers/greybus.

To come after this is the movement of the Documentation entries and a number of the module drivers that are stable.

Greg Kroah-Hartman (9):
staging: greybus: fix up SPDX comment in .h files
staging: greybus: remove license "boilerplate"
staging: greybus: hd: Fix up some alignment checkpatch issues
staging: greybus: manifest: Fix up some alignment checkpatch issues
staging: greybus: log: Fix up some alignment checkpatch issues
staging: greybus: loopback: Fix up some alignment checkpatch issues
staging: greybus: move core include files to include/linux/greybus/
staging: greybus: move the greybus core to drivers/greybus
staging: greybus: move es2 to drivers/greybus/

 MAINTAINERS                                   |   3 +
 drivers/Kconfig                               |   2 +
 drivers/Makefile                              |   1 +
 drivers/greybus/Kconfig                       |  32 +++++
 drivers/greybus/Makefile                      |  26 +++++
 drivers/greybus/arpc.h                        |  63 ++++++++++
 drivers/{staging => }/greybus/bundle.c        |   2 +-
 drivers/{staging => }/greybus/connection.c    |   2 +-
 drivers/{staging => }/greybus/control.c       |   2 +-
 drivers/{staging => }/greybus/core.c          |   2 +-
 drivers/{staging => }/greybus/debugfs.c       |   3 +-
 drivers/{staging => }/greybus/es2.c           |   3 +-
 drivers/{staging => }/greybus/greybus_trace.h |   2 +-
 drivers/{staging => }/greybus/hd.c            |  12 +-
 drivers/{staging => }/greybus/interface.c     |   2 +-
 drivers/{staging => }/greybus/manifest.c      |  41 ++++---
 drivers/{staging => }/greybus/module.c        |   2 +-
 drivers/{staging => }/greybus/operation.c     |   2 +-
 drivers/{staging => }/greybus/svc.c           |   3 +-
 drivers/{staging => }/greybus/svc_watchdog.c  |   2 +-
 .../Documentation/firmware/authenticate.c     |  46 --------
 .../greybus/Documentation/firmware/firmware.c |  46 --------
 drivers/staging/greybus/Kconfig               |  27 -----
 drivers/staging/greybus/Makefile              |  22 ----
 drivers/staging/greybus/arche-platform.c      |   2 +-
 drivers/staging/greybus/arpc.h                | 109 ------------------
 drivers/staging/greybus/audio_apbridgea.c     |   3 +-
 drivers/staging/greybus/audio_apbridgea.h     |  26 +----
 drivers/staging/greybus/audio_codec.h         |   4 +-
 drivers/staging/greybus/audio_gb.c            |   4 +-
 drivers/staging/greybus/authentication.c      |   3 +-
 drivers/staging/greybus/bootrom.c             |   2 +-
 drivers/staging/greybus/camera.c              |   2 +-
 drivers/staging/greybus/firmware.h            |   4 +-
 drivers/staging/greybus/fw-core.c             |   2 +-
 drivers/staging/greybus/fw-download.c         |   2 +-
 drivers/staging/greybus/fw-management.c       |   2 +-
 drivers/staging/greybus/gb-camera.h           |   2 +-
 drivers/staging/greybus/gbphy.c               |   2 +-
 drivers/staging/greybus/gbphy.h               |   2 +-
 drivers/staging/greybus/gpio.c                |   2 +-
 .../staging/greybus/greybus_authentication.h  |  48 +-------
 drivers/staging/greybus/greybus_firmware.h    |  48 +-------
 drivers/staging/greybus/hid.c                 |   3 +-
 drivers/staging/greybus/i2c.c                 |   2 +-
 drivers/staging/greybus/light.c               |   4 +-
 drivers/staging/greybus/log.c                 |   9 +-
 drivers/staging/greybus/loopback.c            |   9 +-
 drivers/staging/greybus/power_supply.c        |   3 +-
 drivers/staging/greybus/pwm.c                 |   2 +-
 drivers/staging/greybus/raw.c                 |   3 +-
 drivers/staging/greybus/sdio.c                |   2 +-
 drivers/staging/greybus/spi.c                 |   2 +-
 drivers/staging/greybus/spilib.c              |   2 +-
 drivers/staging/greybus/spilib.h              |   2 +-
 drivers/staging/greybus/tools/loopback_test.c |   2 -
 drivers/staging/greybus/uart.c                |   2 +-
 drivers/staging/greybus/usb.c                 |   2 +-
 drivers/staging/greybus/vibrator.c            |   3 +-
 .../greybus => include/linux}/greybus.h       |  26 ++---
 .../linux}/greybus/bundle.h                   |   0
 .../linux}/greybus/connection.h               |   0
 .../linux}/greybus/control.h                  |   0
 .../linux}/greybus/greybus_id.h               |   0
 .../linux}/greybus/greybus_manifest.h         |   2 +-
 .../linux}/greybus/greybus_protocols.h        |  48 +-------
 .../staging => include/linux}/greybus/hd.h    |   2 +-
 .../linux}/greybus/interface.h                |   2 +-
 .../linux}/greybus/manifest.h                 |   2 +-
 .../linux}/greybus/module.h                   |   2 +-
 .../linux}/greybus/operation.h                |   2 +-
 .../staging => include/linux}/greybus/svc.h   |   2 +-
 72 files changed, 225 insertions(+), 532 deletions(-)
 create mode 100644 drivers/greybus/Kconfig
 create mode 100644 drivers/greybus/Makefile
 create mode 100644 drivers/greybus/arpc.h
 rename drivers/{staging => }/greybus/bundle.c (99%)
 rename drivers/{staging => }/greybus/connection.c (99%)
 rename drivers/{staging => }/greybus/control.c (99%)
 rename drivers/{staging => }/greybus/core.c (99%)
 rename drivers/{staging => }/greybus/debugfs.c (94%)
 rename drivers/{staging => }/greybus/es2.c (99%)
 rename drivers/{staging => }/greybus/greybus_trace.h (99%)
 rename drivers/{staging => }/greybus/hd.c (96%)
 rename drivers/{staging => }/greybus/interface.c (99%)
 rename drivers/{staging => }/greybus/manifest.c (95%)
 rename drivers/{staging => }/greybus/module.c (99%)
 rename drivers/{staging => }/greybus/operation.c (99%)
 rename drivers/{staging => }/greybus/svc.c (99%)
 rename drivers/{staging => }/greybus/svc_watchdog.c (99%)
 delete mode 100644 drivers/staging/greybus/arpc.h
 rename {drivers/staging/greybus => include/linux}/greybus.h (88%)
 rename {drivers/staging => include/linux}/greybus/bundle.h (100%)
 rename {drivers/staging => include/linux}/greybus/connection.h (100%)
 rename {drivers/staging => include/linux}/greybus/control.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_id.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_manifest.h (99%)
 rename {drivers/staging => include/linux}/greybus/greybus_protocols.h (96%)
 rename {drivers/staging => include/linux}/greybus/hd.h (98%)
 rename {drivers/staging => include/linux}/greybus/interface.h (98%)
 rename {drivers/staging => include/linux}/greybus/manifest.h (87%)
 rename {drivers/staging => include/linux}/greybus/module.h (94%)
 rename {drivers/staging => include/linux}/greybus/operation.h (99%)
 rename {drivers/staging => include/linux}/greybus/svc.h (98%)
Signature · 1 line
2.23.0
author maintainer
#1 lore raw

PATCH 1/9 staging: greybus: fix up SPDX comment in .h files

When these files originally got an SPDX tag, I used // instead of /* */ for the .h files. Fix this up to use // properly.

---
 drivers/staging/greybus/firmware.h               | 2 +-
 drivers/staging/greybus/gb-camera.h              | 2 +-
 drivers/staging/greybus/gbphy.h                  | 2 +-
 drivers/staging/greybus/greybus.h                | 2 +-
 drivers/staging/greybus/greybus_authentication.h | 2 +-
 drivers/staging/greybus/greybus_firmware.h       | 2 +-
 drivers/staging/greybus/greybus_manifest.h       | 2 +-
 drivers/staging/greybus/greybus_protocols.h      | 2 +-
 drivers/staging/greybus/greybus_trace.h          | 2 +-
 drivers/staging/greybus/hd.h                     | 2 +-
 drivers/staging/greybus/interface.h              | 2 +-
 drivers/staging/greybus/manifest.h               | 2 +-
 drivers/staging/greybus/module.h                 | 2 +-
 drivers/staging/greybus/operation.h              | 2 +-
 drivers/staging/greybus/spilib.h                 | 2 +-
 drivers/staging/greybus/svc.h                    | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
drivers/staging/greybus/firmware.h +1 -1
index 946221307ef6..72dfabfa4704 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus Firmware Management Header
  *
drivers/staging/greybus/gb-camera.h +1 -1
index ee293e461fc3..5fc469101fc1 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus Camera protocol driver.
  *
drivers/staging/greybus/gbphy.h +1 -1
index 99463489d7d6..087928a586fb 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus Bridged-Phy Bus driver
  *
drivers/staging/greybus/greybus.h +1 -1
index d03ddb7c9df0..f0488ffff93e 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus driver and device API
  *
drivers/staging/greybus/greybus_authentication.h +1 -1
index 03ea9615b217..d654760cf175 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
 /*
  * Greybus Component Authentication User Header
  *
drivers/staging/greybus/greybus_firmware.h +1 -1
index b58281a63ba4..13ef3aa5279e 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
 /*
  * Greybus Firmware Management User Header
  *
drivers/staging/greybus/greybus_manifest.h +1 -1
index 2cec5cf7a846..db68f7e7d5a7 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus manifest definition
  *
drivers/staging/greybus/greybus_protocols.h +1 -1
index ddc73f10eb22..7d649a7fc4c9 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
 /*
  * This file is provided under a dual BSD/GPLv2 license.  When using or
  * redistributing this file, you may do so under either license.
drivers/staging/greybus/greybus_trace.h +1 -1
index 7b5e2c6b1f6b..1bc9f1275c65 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus driver and device API
  *
drivers/staging/greybus/hd.h +1 -1
index 6cf024a20a58..348b76fabc9a 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus Host Device
  *
drivers/staging/greybus/interface.h +1 -1
index 1c00c5bb3ec9..8fb1eacda302 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus Interface Block code
  *
drivers/staging/greybus/manifest.h +1 -1
index f3c95a255631..88aa7e44cad5 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus manifest parsing
  *
drivers/staging/greybus/module.h +1 -1
index b1ebcc6636db..2a27e520ee94 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus Module code
  *
drivers/staging/greybus/operation.h +1 -1
index 40b7b02fff88..17ba3daf111b 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus operations
  *
drivers/staging/greybus/spilib.h +1 -1
index 043d4d32c3ee..9d416839e3be 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus SPI library header
  *
drivers/staging/greybus/svc.h +1 -1
index ad01783bac9c..e7452057cfe4 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Greybus SVC code
  *
Signature · 1 line
2.23.0
author maintainer
#7 lore raw

PATCH 2/9 staging: greybus: remove license "boilerplate"

In reply to Greg Kroah-Hartman

When the greybus drivers were converted to SPDX identifiers for the license text, some license boilerplate was not removed. Clean this up by removing this unneeded text now.

Cc Johan Hovold <[email protected]>
Cc Alex Elder <[email protected]>
Cc Vaibhav Agarwal <[email protected]>
Cc Mark Greer <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc "Bryan O'Donoghue" <[email protected]>
---
 .../Documentation/firmware/authenticate.c     | 46 -------------------
 .../greybus/Documentation/firmware/firmware.c | 46 -------------------
 drivers/staging/greybus/arpc.h                | 46 -------------------
 drivers/staging/greybus/audio_apbridgea.h     | 26 +----------
 .../staging/greybus/greybus_authentication.h  | 46 -------------------
 drivers/staging/greybus/greybus_firmware.h    | 46 -------------------
 drivers/staging/greybus/greybus_protocols.h   | 46 -------------------
 drivers/staging/greybus/tools/loopback_test.c |  2 -
 8 files changed, 1 insertion(+), 303 deletions(-)
drivers/staging/greybus/Documentation/firmware/authenticate.c +0 -46
index 806e75b7f405..3d2c6f88a138 100644
@@ -2,54 +2,8 @@
 /*
  * Sample code to test CAP protocol
  *
- * This file is provided under a dual BSD/GPLv2 license.  When using or
- * redistributing this file, you may do so under either license.
- *
- * GPL LICENSE SUMMARY
- *
  * Copyright(c) 2016 Google Inc. All rights reserved.
  * Copyright(c) 2016 Linaro Ltd. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details.
- *
- * BSD LICENSE
- *
- * Copyright(c) 2016 Google Inc. All rights reserved.
- * Copyright(c) 2016 Linaro Ltd. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *  * Neither the name of Google Inc. or Linaro Ltd. nor the names of
- *    its contributors may be used to endorse or promote products
- *    derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
- * LINARO LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include <stdio.h>
drivers/staging/greybus/Documentation/firmware/firmware.c +0 -46

54 lines not on this page · raw message

drivers/staging/greybus/arpc.h +0 -46

53 lines not on this page · raw message

drivers/staging/greybus/audio_apbridgea.h +1 -25
index 330fc7a397eb..3f1f4dd2c61a 100644
@@ -1,30 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause */
-/**
+/*
  * Copyright (c) 2015-2016 Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 /*
  * This is a special protocol for configuring communication over the
drivers/staging/greybus/greybus_authentication.h +0 -46

54 lines not on this page · raw message

drivers/staging/greybus/greybus_firmware.h +0 -46

54 lines not on this page · raw message

drivers/staging/greybus/greybus_protocols.h +0 -46

53 lines not on this page · raw message

drivers/staging/greybus/tools/loopback_test.c +0 -2
index cebc1d90a180..ba6f905f26fa 100644
@@ -4,8 +4,6 @@
  *
  * Copyright 2015 Google Inc.
  * Copyright 2015 Linaro Ltd.
- *
- * Provided under the three clause BSD license found in the LICENSE file.
  */
 #include <errno.h>
 #include <fcntl.h>
Signature · 1 line
2.23.0
author maintainer
#10 lore raw

PATCH 3/9 staging: greybus: hd: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/hd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/greybus/hd.c +5 -5
index 969f86697673..e2b9ab5f6ec2 100644
@@ -31,7 +31,7 @@ int gb_hd_output(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
 EXPORT_SYMBOL_GPL(gb_hd_output);
 
 static ssize_t bus_id_show(struct device *dev,
-				struct device_attribute *attr, char *buf)
+			   struct device_attribute *attr, char *buf)
 {
 	struct gb_host_device *hd = to_gb_host_device(dev);
 
@@ -70,7 +70,7 @@ EXPORT_SYMBOL_GPL(gb_hd_cport_release_reserved);
 
 /* Locking: Caller guarantees serialisation */
 int gb_hd_cport_allocate(struct gb_host_device *hd, int cport_id,
-				unsigned long flags)
+			 unsigned long flags)
 {
 	struct ida *id_map = &hd->cport_id_map;
 	int ida_start, ida_end;
@@ -122,9 +122,9 @@ struct device_type greybus_hd_type = {
 };
 
 struct gb_host_device *gb_hd_create(struct gb_hd_driver *driver,
-					struct device *parent,
-					size_t buffer_size_max,
-					size_t num_cports)
+				    struct device *parent,
+				    size_t buffer_size_max,
+				    size_t num_cports)
 {
 	struct gb_host_device *hd;
 	int ret;
Signature · 1 line
2.23.0
author maintainer
#12 lore raw

PATCH 4/9 staging: greybus: manifest: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/manifest.c | 39 +++++++++++++++---------------
 1 file changed, 19 insertions(+), 20 deletions(-)
drivers/staging/greybus/manifest.c +19 -20
index 08db49264f2b..4ebbba52b07c 100644
@@ -104,15 +104,15 @@ static int identify_descriptor(struct gb_interface *intf,
 	size_t expected_size;
 
 	if (size < sizeof(*desc_header)) {
-		dev_err(&intf->dev, "manifest too small (%zu < %zu)\n",
-				size, sizeof(*desc_header));
+		dev_err(&intf->dev, "manifest too small (%zu < %zu)\n", size,
+			sizeof(*desc_header));
 		return -EINVAL;		/* Must at least have header */
 	}
 
 	desc_size = le16_to_cpu(desc_header->size);
 	if (desc_size > size) {
 		dev_err(&intf->dev, "descriptor too big (%zu > %zu)\n",
-				desc_size, size);
+			desc_size, size);
 		return -EINVAL;
 	}
 
@@ -139,22 +139,22 @@ static int identify_descriptor(struct gb_interface *intf,
 	case GREYBUS_TYPE_INVALID:
 	default:
 		dev_err(&intf->dev, "invalid descriptor type (%u)\n",
-				desc_header->type);
+			desc_header->type);
 		return -EINVAL;
 	}
 
 	if (desc_size < expected_size) {
 		dev_err(&intf->dev, "%s descriptor too small (%zu < %zu)\n",
-				get_descriptor_type_string(desc_header->type),
-				desc_size, expected_size);
+			get_descriptor_type_string(desc_header->type),
+			desc_size, expected_size);
 		return -EINVAL;
 	}
 
 	/* Descriptor bigger than what we expect */
 	if (desc_size > expected_size) {
 		dev_warn(&intf->dev, "%s descriptor size mismatch (want %zu got %zu)\n",
-				get_descriptor_type_string(desc_header->type),
-				expected_size, desc_size);
+			 get_descriptor_type_string(desc_header->type),
+			 expected_size, desc_size);
 	}
 
 	descriptor = kzalloc(sizeof(*descriptor), GFP_KERNEL);
@@ -208,7 +208,7 @@ static char *gb_string_get(struct gb_interface *intf, u8 string_id)
 
 	/* Allocate an extra byte so we can guarantee it's NUL-terminated */
 	string = kmemdup(&desc_string->string, desc_string->length + 1,
-				GFP_KERNEL);
+			 GFP_KERNEL);
 	if (!string)
 		return ERR_PTR(-ENOMEM);
 	string[desc_string->length] = '\0';
@@ -264,8 +264,7 @@ static u32 gb_manifest_parse_cports(struct gb_bundle *bundle)
 			desc_cport = tmp->data;
 			if (cport_id == le16_to_cpu(desc_cport->id)) {
 				dev_err(&bundle->dev,
-						"duplicate CPort %u found\n",
-						cport_id);
+					"duplicate CPort %u found\n", cport_id);
 				goto exit;
 			}
 		}
@@ -277,7 +276,7 @@ static u32 gb_manifest_parse_cports(struct gb_bundle *bundle)
 		return 0;
 
 	bundle->cport_desc = kcalloc(count, sizeof(*bundle->cport_desc),
-					GFP_KERNEL);
+				     GFP_KERNEL);
 	if (!bundle->cport_desc)
 		goto exit;
 
@@ -287,7 +286,7 @@ static u32 gb_manifest_parse_cports(struct gb_bundle *bundle)
 	list_for_each_entry_safe(desc, next, &list, links) {
 		desc_cport = desc->data;
 		memcpy(&bundle->cport_desc[i++], desc_cport,
-				sizeof(*desc_cport));
+		       sizeof(*desc_cport));
 
 		/* Release the cport descriptor */
 		release_manifest_descriptor(desc);
@@ -333,9 +332,9 @@ static u32 gb_manifest_parse_bundles(struct gb_interface *intf)
 		/* Ignore any legacy control bundles */
 		if (bundle_id == GB_CONTROL_BUNDLE_ID) {
 			dev_dbg(&intf->dev, "%s - ignoring control bundle\n",
-					__func__);
+				__func__);
 			release_cport_descriptors(&intf->manifest_descs,
-								bundle_id);
+						  bundle_id);
 			continue;
 		}
 
@@ -468,7 +467,7 @@ bool gb_manifest_parse(struct gb_interface *intf, void *data, size_t size)
 	/* we have to have at _least_ the manifest header */
 	if (size < sizeof(*header)) {
 		dev_err(&intf->dev, "short manifest (%zu < %zu)\n",
-				size, sizeof(*header));
+			size, sizeof(*header));
 		return false;
 	}
 
@@ -478,15 +477,15 @@ bool gb_manifest_parse(struct gb_interface *intf, void *data, size_t size)
 	manifest_size = le16_to_cpu(header->size);
 	if (manifest_size != size) {
 		dev_err(&intf->dev, "manifest size mismatch (%zu != %u)\n",
-				size, manifest_size);
+			size, manifest_size);
 		return false;
 	}
 
 	/* Validate major/minor number */
 	if (header->version_major > GREYBUS_VERSION_MAJOR) {
 		dev_err(&intf->dev, "manifest version too new (%u.%u > %u.%u)\n",
-				header->version_major, header->version_minor,
-				GREYBUS_VERSION_MAJOR, GREYBUS_VERSION_MINOR);
+			header->version_major, header->version_minor,
+			GREYBUS_VERSION_MAJOR, GREYBUS_VERSION_MINOR);
 		return false;
 	}
 
@@ -513,7 +512,7 @@ bool gb_manifest_parse(struct gb_interface *intf, void *data, size_t size)
 	}
 	if (found != 1) {
 		dev_err(&intf->dev, "manifest must have 1 interface descriptor (%u found)\n",
-				found);
+			found);
 		result = false;
 		goto out;
 	}
Signature · 1 line
2.23.0
author maintainer
#14 lore raw

PATCH 5/9 staging: greybus: log: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/greybus/log.c +3 -3
index 15a88574dbb0..4f1f161ff11c 100644
@@ -31,14 +31,14 @@ static int gb_log_request_handler(struct gb_operation *op)
 	/* Verify size of payload */
 	if (op->request->payload_size < sizeof(*receive)) {
 		dev_err(dev, "log request too small (%zu < %zu)\n",
-				op->request->payload_size, sizeof(*receive));
+			op->request->payload_size, sizeof(*receive));
 		return -EINVAL;
 	}
 	receive = op->request->payload;
 	len = le16_to_cpu(receive->len);
 	if (len != (op->request->payload_size - sizeof(*receive))) {
 		dev_err(dev, "log request wrong size %d vs %zu\n", len,
-				(op->request->payload_size - sizeof(*receive)));
+			(op->request->payload_size - sizeof(*receive)));
 		return -EINVAL;
 	}
 	if (len == 0) {
@@ -83,7 +83,7 @@ static int gb_log_probe(struct gb_bundle *bundle,
 		return -ENOMEM;
 
 	connection = gb_connection_create(bundle, le16_to_cpu(cport_desc->id),
-			gb_log_request_handler);
+					  gb_log_request_handler);
 	if (IS_ERR(connection)) {
 		retval = PTR_ERR(connection);
 		goto error_free;
Signature · 1 line
2.23.0
author maintainer
#16 lore raw

PATCH 6/9 staging: greybus: loopback: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/loopback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/loopback.c +2 -2
index 48d85ebe404a..b0ab0eed5c18 100644
@@ -882,7 +882,7 @@ static int gb_loopback_fn(void *data)
 				gb->type = 0;
 				gb->send_count = 0;
 				sysfs_notify(&gb->dev->kobj,  NULL,
-						"iteration_count");
+					     "iteration_count");
 				dev_dbg(&bundle->dev, "load test complete\n");
 			} else {
 				dev_dbg(&bundle->dev,
@@ -1054,7 +1054,7 @@ static int gb_loopback_probe(struct gb_bundle *bundle,
 
 	/* Allocate kfifo */
 	if (kfifo_alloc(&gb->kfifo_lat, kfifo_depth * sizeof(u32),
-			  GFP_KERNEL)) {
+			GFP_KERNEL)) {
 		retval = -ENOMEM;
 		goto out_conn;
 	}
Signature · 1 line
2.23.0
author maintainer
#18 lore raw

PATCH 7/9 staging: greybus: move core include files to include/linux/greybus/

In reply to Greg Kroah-Hartman

With the goal of moving the core of the greybus code out of staging, the include files need to be moved to include/linux/greybus.h and include/linux/greybus/

Cc Vaibhav Hiremath <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Alex Elder <[email protected]>
Cc Vaibhav Agarwal <[email protected]>
Cc Mark Greer <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Rui Miguel Silva <[email protected]>
Cc David Lin <[email protected]>
Cc "Bryan O'Donoghue" <[email protected]>
---
 drivers/staging/greybus/arche-platform.c      |  2 +-
 drivers/staging/greybus/audio_apbridgea.c     |  3 +--
 drivers/staging/greybus/audio_codec.h         |  4 +---
 drivers/staging/greybus/audio_gb.c            |  4 +---
 drivers/staging/greybus/authentication.c      |  3 +--
 drivers/staging/greybus/bootrom.c             |  2 +-
 drivers/staging/greybus/bundle.c              |  2 +-
 drivers/staging/greybus/camera.c              |  2 +-
 drivers/staging/greybus/connection.c          |  2 +-
 drivers/staging/greybus/control.c             |  2 +-
 drivers/staging/greybus/core.c                |  2 +-
 drivers/staging/greybus/debugfs.c             |  3 +--
 drivers/staging/greybus/es2.c                 |  3 +--
 drivers/staging/greybus/firmware.h            |  2 +-
 drivers/staging/greybus/fw-core.c             |  2 +-
 drivers/staging/greybus/fw-download.c         |  2 +-
 drivers/staging/greybus/fw-management.c       |  2 +-
 drivers/staging/greybus/gbphy.c               |  2 +-
 drivers/staging/greybus/gpio.c                |  2 +-
 drivers/staging/greybus/hd.c                  |  2 +-
 drivers/staging/greybus/hid.c                 |  3 +--
 drivers/staging/greybus/i2c.c                 |  2 +-
 drivers/staging/greybus/interface.c           |  2 +-
 drivers/staging/greybus/light.c               |  4 +---
 drivers/staging/greybus/log.c                 |  3 +--
 drivers/staging/greybus/loopback.c            |  5 +---
 drivers/staging/greybus/manifest.c            |  2 +-
 drivers/staging/greybus/module.c              |  2 +-
 drivers/staging/greybus/operation.c           |  2 +-
 drivers/staging/greybus/power_supply.c        |  3 +--
 drivers/staging/greybus/pwm.c                 |  2 +-
 drivers/staging/greybus/raw.c                 |  3 +--
 drivers/staging/greybus/sdio.c                |  2 +-
 drivers/staging/greybus/spi.c                 |  2 +-
 drivers/staging/greybus/spilib.c              |  2 +-
 drivers/staging/greybus/svc.c                 |  3 +--
 drivers/staging/greybus/svc_watchdog.c        |  2 +-
 drivers/staging/greybus/uart.c                |  2 +-
 drivers/staging/greybus/usb.c                 |  2 +-
 drivers/staging/greybus/vibrator.c            |  3 +--
 .../greybus => include/linux}/greybus.h       | 24 +++++++++----------
 .../linux}/greybus/bundle.h                   |  0
 .../linux}/greybus/connection.h               |  0
 .../linux}/greybus/control.h                  |  0
 .../linux}/greybus/greybus_id.h               |  0
 .../linux}/greybus/greybus_manifest.h         |  0
 .../linux}/greybus/greybus_protocols.h        |  0
 .../staging => include/linux}/greybus/hd.h    |  0
 .../linux}/greybus/interface.h                |  0
 .../linux}/greybus/manifest.h                 |  0
 .../linux}/greybus/module.h                   |  0
 .../linux}/greybus/operation.h                |  0
 .../staging => include/linux}/greybus/svc.h   |  0
 53 files changed, 52 insertions(+), 71 deletions(-)
 rename {drivers/staging/greybus => include/linux}/greybus.h (89%)
 rename {drivers/staging => include/linux}/greybus/bundle.h (100%)
 rename {drivers/staging => include/linux}/greybus/connection.h (100%)
 rename {drivers/staging => include/linux}/greybus/control.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_id.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_manifest.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_protocols.h (100%)
 rename {drivers/staging => include/linux}/greybus/hd.h (100%)
 rename {drivers/staging => include/linux}/greybus/interface.h (100%)
 rename {drivers/staging => include/linux}/greybus/manifest.h (100%)
 rename {drivers/staging => include/linux}/greybus/module.h (100%)
 rename {drivers/staging => include/linux}/greybus/operation.h (100%)
 rename {drivers/staging => include/linux}/greybus/svc.h (100%)
drivers/staging/greybus/arche-platform.c +1 -1
index 6eb842040c22..eebf0deb39f5 100644
@@ -19,8 +19,8 @@
 #include <linux/irq.h>
 #include <linux/suspend.h>
 #include <linux/time.h>
+#include <linux/greybus.h>
 #include "arche_platform.h"
-#include "greybus.h"
 
 #if IS_ENABLED(CONFIG_USB_HSIC_USB3613)
 #include <linux/usb/usb3613.h>
drivers/staging/greybus/audio_apbridgea.c +1 -2
index 7ebb1bde5cb7..26117e390deb 100644
@@ -5,8 +5,7 @@
  * Copyright 2015-2016 Google Inc.
  */
 
-#include "greybus.h"
-#include "greybus_protocols.h"
+#include <linux/greybus.h>
 #include "audio_apbridgea.h"
 #include "audio_codec.h"
 
drivers/staging/greybus/audio_codec.h +1 -3
index 9ba09ea9c2fc..cb5d271da1a5 100644
@@ -8,12 +8,10 @@
 #ifndef __LINUX_GBAUDIO_CODEC_H
 #define __LINUX_GBAUDIO_CODEC_H
 
+#include <linux/greybus.h>
 #include <sound/soc.h>
 #include <sound/jack.h>
 
-#include "greybus.h"
-#include "greybus_protocols.h"
-
 #define NAME_SIZE	32
 #define MAX_DAIS	2	/* APB1, APB2 */
 
drivers/staging/greybus/audio_gb.c +1 -3
index 8894f1c87d48..9d8994fdb41a 100644
@@ -5,9 +5,7 @@
  * Copyright 2015-2016 Google Inc.
  */
 
-#include "greybus.h"
-#include "greybus_protocols.h"
-#include "operation.h"
+#include <linux/greybus.h>
 #include "audio_codec.h"
 
 /* TODO: Split into separate calls */
drivers/staging/greybus/authentication.c +1 -2
index a5d7c53df987..297e69f011c7 100644
@@ -6,8 +6,7 @@
  * Copyright 2016 Linaro Ltd.
  */
 
-#include "greybus.h"
-
+#include <linux/greybus.h>
 #include <linux/cdev.h>
 #include <linux/fs.h>
 #include <linux/ioctl.h>
drivers/staging/greybus/bootrom.c +1 -1
index 402e6360834f..a8efb86de140 100644
@@ -10,8 +10,8 @@
 #include <linux/jiffies.h>
 #include <linux/mutex.h>
 #include <linux/workqueue.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "firmware.h"
 
 /* Timeout, in jiffies, within which the next request must be received */
drivers/staging/greybus/bundle.c +1 -1
index 3f702db9e098..84660729538b 100644
@@ -6,7 +6,7 @@
  * Copyright 2014-2015 Linaro Ltd.
  */
 
-#include "greybus.h"
+#include <linux/greybus.h>
 #include "greybus_trace.h"
 
 static ssize_t bundle_class_show(struct device *dev,
drivers/staging/greybus/camera.c +1 -1
index 615c8e7fd51e..b570e13394ac 100644
@@ -14,9 +14,9 @@
 #include <linux/string.h>
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
+#include <linux/greybus.h>
 
 #include "gb-camera.h"
-#include "greybus.h"
 #include "greybus_protocols.h"
 
 enum gb_camera_debugs_buffer_id {
drivers/staging/greybus/connection.c +1 -1
index eda964208cce..fc8f57f97ce6 100644
@@ -7,8 +7,8 @@
  */
 
 #include <linux/workqueue.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "greybus_trace.h"
 
 #define GB_CONNECTION_CPORT_QUIESCE_TIMEOUT	1000
drivers/staging/greybus/control.c +1 -1
index a9e8b6036cac..359a25841973 100644
@@ -9,7 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include "greybus.h"
+#include <linux/greybus.h>
 
 /* Highest control-protocol version supported */
 #define GB_CONTROL_VERSION_MAJOR	0
drivers/staging/greybus/core.c +1 -1
index d6b0d49130c0..e546c6431877 100644
@@ -9,7 +9,7 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #define CREATE_TRACE_POINTS
-#include "greybus.h"
+#include <linux/greybus.h>
 #include "greybus_trace.h"
 
 #define GB_BUNDLE_AUTOSUSPEND_MS	3000
drivers/staging/greybus/debugfs.c +1 -2
index 56e20c30feb5..e102d7badb9d 100644
@@ -7,8 +7,7 @@
  */
 
 #include <linux/debugfs.h>
-
-#include "greybus.h"
+#include <linux/greybus.h>
 
 static struct dentry *gb_debug_root;
 
drivers/staging/greybus/es2.c +1 -2
index be6af18cec31..366716f11b1a 100644
@@ -11,12 +11,11 @@
 #include <linux/kfifo.h>
 #include <linux/debugfs.h>
 #include <linux/list.h>
+#include <linux/greybus.h>
 #include <asm/unaligned.h>
 
 #include "arpc.h"
-#include "greybus.h"
 #include "greybus_trace.h"
-#include "connection.h"
 
 
 /* Default timeout for USB vendor requests. */
drivers/staging/greybus/firmware.h +1 -1
index 72dfabfa4704..5d2564462ffc 100644
@@ -9,7 +9,7 @@
 #ifndef __FIRMWARE_H
 #define __FIRMWARE_H
 
-#include "greybus.h"
+#include <linux/greybus.h>
 
 #define FW_NAME_PREFIX	"gmp_"
 
drivers/staging/greybus/fw-core.c +1 -1
index 388866d92f5b..57bebf24636b 100644
@@ -8,8 +8,8 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/firmware.h>
+#include <linux/greybus.h>
 #include "firmware.h"
-#include "greybus.h"
 #include "spilib.h"
 
 struct gb_fw_core {
drivers/staging/greybus/fw-download.c +1 -1
index d3b7cccbc10d..543692c567f9 100644
@@ -10,8 +10,8 @@
 #include <linux/jiffies.h>
 #include <linux/mutex.h>
 #include <linux/workqueue.h>
+#include <linux/greybus.h>
 #include "firmware.h"
-#include "greybus.h"
 
 /* Estimated minimum buffer size, actual size can be smaller than this */
 #define MIN_FETCH_SIZE		512
drivers/staging/greybus/fw-management.c +1 -1
index 71aec14f8181..687c6405c65b 100644
@@ -13,10 +13,10 @@
 #include <linux/idr.h>
 #include <linux/ioctl.h>
 #include <linux/uaccess.h>
+#include <linux/greybus.h>
 
 #include "firmware.h"
 #include "greybus_firmware.h"
-#include "greybus.h"
 
 #define FW_MGMT_TIMEOUT_MS		1000
 
drivers/staging/greybus/gbphy.c +1 -1
index 6cb85c3d3572..9fc5c47be9bd 100644
@@ -13,8 +13,8 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/device.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 
 #define GB_GBPHY_AUTOSUSPEND_MS	3000
drivers/staging/greybus/gpio.c +1 -1
index 3151004d26fb..1ff34abd5692 100644
@@ -13,8 +13,8 @@
 #include <linux/irqdomain.h>
 #include <linux/gpio/driver.h>
 #include <linux/mutex.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 
 struct gb_gpio_line {
drivers/staging/greybus/hd.c +1 -1
index e2b9ab5f6ec2..72b21bf2d7d3 100644
@@ -8,8 +8,8 @@
 
 #include <linux/kernel.h>
 #include <linux/slab.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "greybus_trace.h"
 
 EXPORT_TRACEPOINT_SYMBOL_GPL(gb_hd_create);
drivers/staging/greybus/hid.c +1 -2
index 8ab810bf5716..04bfd9110502 100644
@@ -12,8 +12,7 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
-
-#include "greybus.h"
+#include <linux/greybus.h>
 
 /* Greybus HID device's structure */
 struct gb_hid {
drivers/staging/greybus/i2c.c +1 -1
index b2522043a1a4..ab06fc3b9e7e 100644
@@ -10,8 +10,8 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 
 struct gb_i2c_device {
drivers/staging/greybus/interface.c +1 -1
index d7b5b89a2f40..67dbe6fda9a1 100644
@@ -7,8 +7,8 @@
  */
 
 #include <linux/delay.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "greybus_trace.h"
 
 #define GB_INTERFACE_MODE_SWITCH_TIMEOUT	2000
drivers/staging/greybus/light.c +1 -3
index 010ae1e9c7fb..b3b1b253d112 100644
@@ -11,11 +11,9 @@
 #include <linux/led-class-flash.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/greybus.h>
 #include <media/v4l2-flash-led-class.h>
 
-#include "greybus.h"
-#include "greybus_protocols.h"
-
 #define NAMES_MAX	32
 
 struct gb_channel {
drivers/staging/greybus/log.c +1 -2
index 4f1f161ff11c..971f36dccac6 100644
@@ -9,8 +9,7 @@
 #include <linux/slab.h>
 #include <linux/sizes.h>
 #include <linux/uaccess.h>
-
-#include "greybus.h"
+#include <linux/greybus.h>
 
 struct gb_log {
 	struct gb_connection *connection;
drivers/staging/greybus/loopback.c +1 -4
index b0ab0eed5c18..583d9708a191 100644
@@ -25,12 +25,9 @@
 #include <linux/workqueue.h>
 #include <linux/atomic.h>
 #include <linux/pm_runtime.h>
-
+#include <linux/greybus.h>
 #include <asm/div64.h>
 
-#include "greybus.h"
-#include "connection.h"
-
 #define NSEC_PER_DAY 86400000000000ULL
 
 struct gb_loopback_stats {
drivers/staging/greybus/manifest.c +1 -1
index 4ebbba52b07c..dd7040697bde 100644
@@ -6,7 +6,7 @@
  * Copyright 2014-2015 Linaro Ltd.
  */
 
-#include "greybus.h"
+#include <linux/greybus.h>
 
 static const char *get_descriptor_type_string(u8 type)
 {
drivers/staging/greybus/module.c +1 -1
index b251a53d0e8e..36f77f9e1d74 100644
@@ -6,7 +6,7 @@
  * Copyright 2016 Linaro Ltd.
  */
 
-#include "greybus.h"
+#include <linux/greybus.h>
 #include "greybus_trace.h"
 
 static ssize_t eject_store(struct device *dev,
drivers/staging/greybus/operation.c +1 -1
index fe268f7b63ed..8459e9bc0749 100644
@@ -12,8 +12,8 @@
 #include <linux/sched.h>
 #include <linux/wait.h>
 #include <linux/workqueue.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "greybus_trace.h"
 
 static struct kmem_cache *gb_operation_cache;
drivers/staging/greybus/power_supply.c +1 -2
index 34b40a409ea3..ec96f28887f9 100644
@@ -10,8 +10,7 @@
 #include <linux/module.h>
 #include <linux/power_supply.h>
 #include <linux/slab.h>
-
-#include "greybus.h"
+#include <linux/greybus.h>
 
 #define PROP_MAX 32
 
drivers/staging/greybus/pwm.c +1 -1
index 4a6d394b6c44..891a6a672378 100644
@@ -10,8 +10,8 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/pwm.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 
 struct gb_pwm_chip {
drivers/staging/greybus/raw.c +1 -2
index 838acbe84ca0..64a17dfe3b6e 100644
@@ -13,8 +13,7 @@
 #include <linux/fs.h>
 #include <linux/idr.h>
 #include <linux/uaccess.h>
-
-#include "greybus.h"
+#include <linux/greybus.h>
 
 struct gb_raw {
 	struct gb_connection *connection;
drivers/staging/greybus/sdio.c +1 -1
index a097a8916b3b..68c5718be827 100644
@@ -12,8 +12,8 @@
 #include <linux/mmc/mmc.h>
 #include <linux/scatterlist.h>
 #include <linux/workqueue.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 
 struct gb_sdio_host {
drivers/staging/greybus/spi.c +1 -1
index 47d896992b35..68e8d272db6d 100644
@@ -7,8 +7,8 @@
  */
 
 #include <linux/module.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 #include "spilib.h"
 
drivers/staging/greybus/spilib.c +1 -1
index 2e07c6b41334..fc27c52de74a 100644
@@ -10,9 +10,9 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/greybus.h>
 #include <linux/spi/spi.h>
 
-#include "greybus.h"
 #include "spilib.h"
 
 struct gb_spilib {
drivers/staging/greybus/svc.c +1 -2
index 05bc45287b87..ce7740ef449b 100644
@@ -8,8 +8,7 @@
 
 #include <linux/debugfs.h>
 #include <linux/workqueue.h>
-
-#include "greybus.h"
+#include <linux/greybus.h>
 
 #define SVC_INTF_EJECT_TIMEOUT		9000
 #define SVC_INTF_ACTIVATE_TIMEOUT	6000
drivers/staging/greybus/svc_watchdog.c +1 -1
index 7868ad8211c5..b6b1682c19c4 100644
@@ -8,7 +8,7 @@
 #include <linux/delay.h>
 #include <linux/suspend.h>
 #include <linux/workqueue.h>
-#include "greybus.h"
+#include <linux/greybus.h>
 
 #define SVC_WATCHDOG_PERIOD	(2 * HZ)
 
drivers/staging/greybus/uart.c +1 -1
index b3bffe91ae99..55c51143bb09 100644
@@ -28,8 +28,8 @@
 #include <linux/kfifo.h>
 #include <linux/workqueue.h>
 #include <linux/completion.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 
 #define GB_NUM_MINORS	16	/* 16 is more than enough */
drivers/staging/greybus/usb.c +1 -1
index 1c246c73a085..8e9d9d59a357 100644
@@ -10,8 +10,8 @@
 #include <linux/slab.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/greybus.h>
 
-#include "greybus.h"
 #include "gbphy.h"
 
 /* Greybus USB request types */
drivers/staging/greybus/vibrator.c +1 -2
index 3e5dedeacd5c..0e2b188e5ca3 100644
@@ -13,8 +13,7 @@
 #include <linux/kdev_t.h>
 #include <linux/idr.h>
 #include <linux/pm_runtime.h>
-
-#include "greybus.h"
+#include <linux/greybus.h>
 
 struct gb_vibrator_device {
 	struct gb_connection	*connection;
include/linux/greybus.h renamed from drivers/staging/greybus/greybus.h +12 -12
similarity index 89%
rename from drivers/staging/greybus/greybus.h
rename to include/linux/greybus.h
index f0488ffff93e..18c0fb958b74 100644
@@ -20,18 +20,18 @@
 #include <linux/pm_runtime.h>
 #include <linux/idr.h>
 
-#include "greybus_id.h"
-#include "greybus_manifest.h"
-#include "greybus_protocols.h"
-#include "manifest.h"
-#include "hd.h"
-#include "svc.h"
-#include "control.h"
-#include "module.h"
-#include "interface.h"
-#include "bundle.h"
-#include "connection.h"
-#include "operation.h"
+#include <linux/greybus/greybus_id.h>
+#include <linux/greybus/greybus_manifest.h>
+#include <linux/greybus/greybus_protocols.h>
+#include <linux/greybus/manifest.h>
+#include <linux/greybus/hd.h>
+#include <linux/greybus/svc.h>
+#include <linux/greybus/control.h>
+#include <linux/greybus/module.h>
+#include <linux/greybus/interface.h>
+#include <linux/greybus/bundle.h>
+#include <linux/greybus/connection.h>
+#include <linux/greybus/operation.h>
 
 /* Matches up with the Greybus Protocol specification document */
 #define GREYBUS_VERSION_MAJOR	0x00
include/linux/greybus/bundle.h renamed from drivers/staging/greybus/bundle.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/bundle.h
rename to include/linux/greybus/bundle.h
include/linux/greybus/connection.h renamed from drivers/staging/greybus/connection.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/connection.h
rename to include/linux/greybus/connection.h
include/linux/greybus/control.h renamed from drivers/staging/greybus/control.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/control.h
rename to include/linux/greybus/control.h
include/linux/greybus/greybus_id.h renamed from drivers/staging/greybus/greybus_id.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/greybus_id.h
rename to include/linux/greybus/greybus_id.h
include/linux/greybus/greybus_manifest.h renamed from drivers/staging/greybus/greybus_manifest.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/greybus_manifest.h
rename to include/linux/greybus/greybus_manifest.h
include/linux/greybus/greybus_protocols.h renamed from drivers/staging/greybus/greybus_protocols.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/greybus_protocols.h
rename to include/linux/greybus/greybus_protocols.h
include/linux/greybus/hd.h renamed from drivers/staging/greybus/hd.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/hd.h
rename to include/linux/greybus/hd.h
include/linux/greybus/interface.h renamed from drivers/staging/greybus/interface.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/interface.h
rename to include/linux/greybus/interface.h
include/linux/greybus/manifest.h renamed from drivers/staging/greybus/manifest.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/manifest.h
rename to include/linux/greybus/manifest.h
include/linux/greybus/module.h renamed from drivers/staging/greybus/module.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/module.h
rename to include/linux/greybus/module.h
include/linux/greybus/operation.h renamed from drivers/staging/greybus/operation.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/operation.h
rename to include/linux/greybus/operation.h
include/linux/greybus/svc.h renamed from drivers/staging/greybus/svc.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/svc.h
rename to include/linux/greybus/svc.h
Signature · 1 line
2.23.0
author maintainer
#21 lore raw

PATCH 8/9 staging: greybus: move the greybus core to drivers/greybus

In reply to Greg Kroah-Hartman

The Greybus core code has been stable for a long time, and has been shipping for many years in millions of phones. With the advent of a recent Google Summer of Code project, and a number of new devices in the works from various companies, it is time to get the core greybus code out of staging as it really is going to be with us for a while.

---
 MAINTAINERS                                   |  3 +++
 drivers/Kconfig                               |  2 ++
 drivers/Makefile                              |  1 +
 drivers/greybus/Kconfig                       | 16 ++++++++++++++++
 drivers/greybus/Makefile                      | 19 +++++++++++++++++++
 drivers/{staging => }/greybus/bundle.c        |  0
 drivers/{staging => }/greybus/connection.c    |  0
 drivers/{staging => }/greybus/control.c       |  0
 drivers/{staging => }/greybus/core.c          |  0
 drivers/{staging => }/greybus/debugfs.c       |  0
 drivers/{staging => }/greybus/greybus_trace.h |  0
 drivers/{staging => }/greybus/hd.c            |  0
 drivers/{staging => }/greybus/interface.c     |  0
 drivers/{staging => }/greybus/manifest.c      |  0
 drivers/{staging => }/greybus/module.c        |  0
 drivers/{staging => }/greybus/operation.c     |  0
 drivers/{staging => }/greybus/svc.c           |  0
 drivers/{staging => }/greybus/svc_watchdog.c  |  0
 drivers/staging/greybus/Kconfig               | 16 ----------------
 drivers/staging/greybus/Makefile              | 17 -----------------
 drivers/staging/greybus/es2.c                 |  2 +-
 21 files changed, 42 insertions(+), 34 deletions(-)
 create mode 100644 drivers/greybus/Kconfig
 create mode 100644 drivers/greybus/Makefile
 rename drivers/{staging => }/greybus/bundle.c (100%)
 rename drivers/{staging => }/greybus/connection.c (100%)
 rename drivers/{staging => }/greybus/control.c (100%)
 rename drivers/{staging => }/greybus/core.c (100%)
 rename drivers/{staging => }/greybus/debugfs.c (100%)
 rename drivers/{staging => }/greybus/greybus_trace.h (100%)
 rename drivers/{staging => }/greybus/hd.c (100%)
 rename drivers/{staging => }/greybus/interface.c (100%)
 rename drivers/{staging => }/greybus/manifest.c (100%)
 rename drivers/{staging => }/greybus/module.c (100%)
 rename drivers/{staging => }/greybus/operation.c (100%)
 rename drivers/{staging => }/greybus/svc.c (100%)
 rename drivers/{staging => }/greybus/svc_watchdog.c (100%)
MAINTAINERS +3 -0
index 0f38cba2c581..e3242687cd19 100644
@@ -7003,6 +7003,9 @@ M:	Alex Elder <[email protected]>
 M:	Greg Kroah-Hartman <[email protected]>
 S:	Maintained
 F:	drivers/staging/greybus/
+F:	drivers/greybus/
+F:	include/linux/greybus.h
+F:	include/linux/greybus/
 L:	[email protected] (moderated for non-subscribers)
 
 GREYBUS UART PROTOCOLS DRIVERS
drivers/Kconfig +2 -0
index 61cf4ea2c229..7dce76ae7369 100644
@@ -146,6 +146,8 @@ source "drivers/hv/Kconfig"
 
 source "drivers/xen/Kconfig"
 
+source "drivers/greybus/Kconfig"
+
 source "drivers/staging/Kconfig"
 
 source "drivers/platform/Kconfig"
drivers/Makefile +1 -0
index 6d37564e783c..73df8e5a2fce 100644
@@ -148,6 +148,7 @@ obj-$(CONFIG_BCMA)		+= bcma/
 obj-$(CONFIG_VHOST_RING)	+= vhost/
 obj-$(CONFIG_VHOST)		+= vhost/
 obj-$(CONFIG_VLYNQ)		+= vlynq/
+obj-$(CONFIG_GREYBUS)		+= greybus/
 obj-$(CONFIG_STAGING)		+= staging/
 obj-y				+= platform/
 
drivers/greybus/Kconfig new file +16 -0
new file mode 100644
index 000000000000..158d8893114c
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0
+menuconfig GREYBUS
+	tristate "Greybus support"
+	depends on SYSFS
+	---help---
+	  This option enables the Greybus driver core.  Greybus is an
+	  hardware protocol that was designed to provide Unipro with a
+	  sane application layer.  It was originally designed for the
+	  ARA project, a module phone system, but has shown up in other
+	  phones, and can be tunneled over other busses in order to
+	  control hardware devices.
+
+	  Say Y here to enable support for these types of drivers.
+
+	  To compile this code as a module, chose M here: the module
+	  will be called greybus.ko
drivers/greybus/Makefile new file +19 -0
new file mode 100644
index 000000000000..03b22616ec7d
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: GPL-2.0
+# Greybus core
+greybus-y :=	core.o		\
+		debugfs.o	\
+		hd.o		\
+		manifest.o	\
+		module.o	\
+		interface.o	\
+		bundle.o	\
+		connection.o	\
+		control.o	\
+		svc.o		\
+		svc_watchdog.o	\
+		operation.o
+
+obj-$(CONFIG_GREYBUS)		+= greybus.o
+
+# needed for trace events
+ccflags-y += -I$(src)
drivers/greybus/bundle.c renamed from drivers/staging/greybus/bundle.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/bundle.c
rename to drivers/greybus/bundle.c
drivers/greybus/connection.c renamed from drivers/staging/greybus/connection.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/connection.c
rename to drivers/greybus/connection.c
drivers/greybus/control.c renamed from drivers/staging/greybus/control.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/control.c
rename to drivers/greybus/control.c
drivers/greybus/core.c renamed from drivers/staging/greybus/core.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/core.c
rename to drivers/greybus/core.c
drivers/greybus/debugfs.c renamed from drivers/staging/greybus/debugfs.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/debugfs.c
rename to drivers/greybus/debugfs.c
drivers/greybus/greybus_trace.h renamed from drivers/staging/greybus/greybus_trace.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/greybus_trace.h
rename to drivers/greybus/greybus_trace.h
drivers/greybus/hd.c renamed from drivers/staging/greybus/hd.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/hd.c
rename to drivers/greybus/hd.c
drivers/greybus/interface.c renamed from drivers/staging/greybus/interface.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/interface.c
rename to drivers/greybus/interface.c
drivers/greybus/manifest.c renamed from drivers/staging/greybus/manifest.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/manifest.c
rename to drivers/greybus/manifest.c
drivers/greybus/module.c renamed from drivers/staging/greybus/module.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/module.c
rename to drivers/greybus/module.c
drivers/greybus/operation.c renamed from drivers/staging/greybus/operation.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/operation.c
rename to drivers/greybus/operation.c
drivers/greybus/svc.c renamed from drivers/staging/greybus/svc.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/svc.c
rename to drivers/greybus/svc.c
drivers/greybus/svc_watchdog.c renamed from drivers/staging/greybus/svc_watchdog.c +0 -0
similarity index 100%
rename from drivers/staging/greybus/svc_watchdog.c
rename to drivers/greybus/svc_watchdog.c
drivers/staging/greybus/Kconfig +0 -16
index 4894c3514955..d03c37e1e6e8 100644
@@ -1,20 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-menuconfig GREYBUS
-	tristate "Greybus support"
-	depends on SYSFS
-	---help---
-	  This option enables the Greybus driver core.  Greybus is an
-	  hardware protocol that was designed to provide Unipro with a
-	  sane application layer.  It was originally designed for the
-	  ARA project, a module phone system, but has shown up in other
-	  phones, and can be tunneled over other busses in order to
-	  control hardware devices.
-
-	  Say Y here to enable support for these types of drivers.
-
-	  To compile this code as a module, chose M here: the module
-	  will be called greybus.ko
-
 if GREYBUS
 
 config GREYBUS_ES2
drivers/staging/greybus/Makefile +0 -17
index 2551ed16b742..d16853399c9a 100644
@@ -1,24 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
-# Greybus core
-greybus-y :=	core.o		\
-		debugfs.o	\
-		hd.o		\
-		manifest.o	\
-		module.o	\
-		interface.o	\
-		bundle.o	\
-		connection.o	\
-		control.o	\
-		svc.o		\
-		svc_watchdog.o	\
-		operation.o
-
-obj-$(CONFIG_GREYBUS)		+= greybus.o
-
 # needed for trace events
 ccflags-y += -I$(src)
 
-
 # Greybus Host controller drivers
 gb-es2-y := es2.o
 
drivers/staging/greybus/es2.c +1 -1
index 366716f11b1a..5b755e76d8a4 100644
@@ -15,7 +15,7 @@
 #include <asm/unaligned.h>
 
 #include "arpc.h"
-#include "greybus_trace.h"
+#include "../../greybus/greybus_trace.h"
 
 
 /* Default timeout for USB vendor requests. */
Signature · 1 line
2.23.0
author maintainer
#23 lore raw

PATCH 9/9 staging: greybus: move es2 to drivers/greybus/

In reply to Greg Kroah-Hartman

The es2 Greybus host controller has long been stable, so move it out of drivers/staging/ to drivers/greybus/

---
 drivers/greybus/Kconfig              | 16 ++++++++++++++++
 drivers/greybus/Makefile             |  7 +++++++
 drivers/{staging => }/greybus/arpc.h |  0
 drivers/{staging => }/greybus/es2.c  |  2 +-
 drivers/staging/greybus/Kconfig      | 11 -----------
 drivers/staging/greybus/Makefile     |  5 -----
 6 files changed, 24 insertions(+), 17 deletions(-)
 rename drivers/{staging => }/greybus/arpc.h (100%)
 rename drivers/{staging => }/greybus/es2.c (99%)
drivers/greybus/Kconfig +16 -0
index 158d8893114c..b84fcaf8b105 100644
@@ -14,3 +14,19 @@ menuconfig GREYBUS
 
 	  To compile this code as a module, chose M here: the module
 	  will be called greybus.ko
+
+if GREYBUS
+
+config GREYBUS_ES2
+	tristate "Greybus ES3 USB host controller"
+	depends on USB
+	---help---
+	  Select this option if you have a Toshiba ES3 USB device that
+	  acts as a Greybus "host controller".  This device is a bridge
+	  from a USB device to a Unipro network.
+
+	  To compile this code as a module, chose M here: the module
+	  will be called gb-es2.ko
+
+endif	# GREYBUS
+
drivers/greybus/Makefile +7 -0
index 03b22616ec7d..9bccdd229aa2 100644
@@ -17,3 +17,10 @@ obj-$(CONFIG_GREYBUS)		+= greybus.o
 
 # needed for trace events
 ccflags-y += -I$(src)
+
+# Greybus Host controller drivers
+gb-es2-y := es2.o
+
+obj-$(CONFIG_GREYBUS_ES2)	+= gb-es2.o
+
+
drivers/greybus/arpc.h renamed from drivers/staging/greybus/arpc.h +0 -0
similarity index 100%
rename from drivers/staging/greybus/arpc.h
rename to drivers/greybus/arpc.h
drivers/greybus/es2.c renamed from drivers/staging/greybus/es2.c +1 -1
similarity index 99%
rename from drivers/staging/greybus/es2.c
rename to drivers/greybus/es2.c
index 5b755e76d8a4..366716f11b1a 100644
@@ -15,7 +15,7 @@
 #include <asm/unaligned.h>
 
 #include "arpc.h"
-#include "../../greybus/greybus_trace.h"
+#include "greybus_trace.h"
 
 
 /* Default timeout for USB vendor requests. */
drivers/staging/greybus/Kconfig +0 -11
index d03c37e1e6e8..d4777f5a8b90 100644
@@ -1,17 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 if GREYBUS
 
-config GREYBUS_ES2
-	tristate "Greybus ES3 USB host controller"
-	depends on USB
-	---help---
-	  Select this option if you have a Toshiba ES3 USB device that
-	  acts as a Greybus "host controller".  This device is a bridge
-	  from a USB device to a Unipro network.
-
-	  To compile this code as a module, chose M here: the module
-	  will be called gb-es2.ko
-
 config GREYBUS_AUDIO
 	tristate "Greybus Audio Class driver"
 	depends on SOUND
drivers/staging/greybus/Makefile +0 -5
index d16853399c9a..627e44f2a983 100644
@@ -2,11 +2,6 @@
 # needed for trace events
 ccflags-y += -I$(src)
 
-# Greybus Host controller drivers
-gb-es2-y := es2.o
-
-obj-$(CONFIG_GREYBUS_ES2)	+= gb-es2.o
-
 # Greybus class drivers
 gb-bootrom-y		:= bootrom.o
 gb-camera-y		:= camera.o
Signature · 1 line
2.23.0
Acked-by on v1 1/9
#2 lore raw

Re: [PATCH 1/9] staging: greybus: fix up SPDX comment in .h files

In reply to Greg Kroah-Hartman
Quoted 19 lines · Greg Kroah-Hartman

When these files originally got an SPDX tag, I used // instead of /* */ for the .h files. Fix this up to use // properly.

---
 drivers/staging/greybus/firmware.h               | 2 +-
 drivers/staging/greybus/gb-camera.h              | 2 +-
 drivers/staging/greybus/gbphy.h                  | 2 +-
 drivers/staging/greybus/greybus.h                | 2 +-
 drivers/staging/greybus/greybus_authentication.h | 2 +-
 drivers/staging/greybus/greybus_firmware.h       | 2 +-
 drivers/staging/greybus/greybus_manifest.h       | 2 +-
 drivers/staging/greybus/greybus_protocols.h      | 2 +-
 drivers/staging/greybus/greybus_trace.h          | 2 +-
Quoted 8 lines
 drivers/staging/greybus/hd.h                     | 2 +-
 drivers/staging/greybus/interface.h              | 2 +-
 drivers/staging/greybus/manifest.h               | 2 +-
 drivers/staging/greybus/module.h                 | 2 +-
 drivers/staging/greybus/operation.h              | 2 +-
 drivers/staging/greybus/spilib.h                 | 2 +-
 drivers/staging/greybus/svc.h                    | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
viresh
Acked-by on v1 2/9
#8 lore raw

Re: [PATCH 2/9] staging: greybus: remove license "boilerplate"

In reply to Greg Kroah-Hartman
Quoted 13 lines · Greg Kroah-Hartman

When the greybus drivers were converted to SPDX identifiers for the license text, some license boilerplate was not removed. Clean this up by removing this unneeded text now.

Cc Johan Hovold <[email protected]>
Cc Alex Elder <[email protected]>
Cc Vaibhav Agarwal <[email protected]>
Cc Mark Greer <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc "Bryan O'Donoghue" <[email protected]>
Quoted 10 lines
---
 .../Documentation/firmware/authenticate.c     | 46 -------------------
 .../greybus/Documentation/firmware/firmware.c | 46 -------------------
 drivers/staging/greybus/arpc.h                | 46 -------------------
 drivers/staging/greybus/audio_apbridgea.h     | 26 +----------
 .../staging/greybus/greybus_authentication.h  | 46 -------------------
 drivers/staging/greybus/greybus_firmware.h    | 46 -------------------
 drivers/staging/greybus/greybus_protocols.h   | 46 -------------------
 drivers/staging/greybus/tools/loopback_test.c |  2 -
 8 files changed, 1 insertion(+), 303 deletions(-)
Signature · 1 line
viresh
Acked-by on v1 7/9
#19 lore raw

Re: [PATCH 7/9] staging: greybus: move core include files to include/linux/greybus/

In reply to Greg Kroah-Hartman
Quoted 4 lines · Greg Kroah-Hartman

With the goal of moving the core of the greybus code out of staging, the include files need to be moved to include/linux/greybus.h and include/linux/greybus/

Quoted 12 lines
Cc Vaibhav Hiremath <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Alex Elder <[email protected]>
Cc Vaibhav Agarwal <[email protected]>
Cc Mark Greer <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Rui Miguel Silva <[email protected]>
Cc David Lin <[email protected]>
Cc "Bryan O'Donoghue" <[email protected]>
Signature · 1 line
viresh
Acked-by on v1 3/9
#11 lore raw

Re: [greybus-dev] [PATCH 3/9] staging: greybus: hd: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman
Quoted 11 lines · Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/hd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
viresh
Acked-by on v1 4/9
#13 lore raw

Re: [greybus-dev] [PATCH 4/9] staging: greybus: manifest: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman
Quoted 17 lines · Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/manifest.c | 39 +++++++++++++++---------------
 1 file changed, 19 insertions(+), 20 deletions(-)
drivers/staging/greybus/manifest.c +0 -0
index 08db49264f2b..4ebbba52b07c 100644

drivers/staging/greybus/manifest.c static int identify_descriptor(struct gb_interface *intf, · line 110

Quoted 9 lines
drivers/staging/greybus/manifest.c +2 -2
@@ -104,15 +104,15 @@ static int identify_descriptor(struct gb_interface *intf,
 	size_t expected_size;
 
 	if (size < sizeof(*desc_header)) {
-		dev_err(&intf->dev, "manifest too small (%zu < %zu)\n",
-				size, sizeof(*desc_header));
+		dev_err(&intf->dev, "manifest too small (%zu < %zu)\n", size,
+			sizeof(*desc_header));
 		return -EINVAL;		/* Must at least have header */
 	}
Signature · 1 line
viresh
Acked-by on v1 5/9
#15 lore raw

Re: [greybus-dev] [PATCH 5/9] staging: greybus: log: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman
Quoted 35 lines · Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/greybus/log.c +2 -2
index 15a88574dbb0..4f1f161ff11c 100644
@@ -31,14 +31,14 @@ static int gb_log_request_handler(struct gb_operation *op)
 	/* Verify size of payload */
 	if (op->request->payload_size < sizeof(*receive)) {
 		dev_err(dev, "log request too small (%zu < %zu)\n",
-				op->request->payload_size, sizeof(*receive));
+			op->request->payload_size, sizeof(*receive));
 		return -EINVAL;
 	}
 	receive = op->request->payload;
 	len = le16_to_cpu(receive->len);
 	if (len != (op->request->payload_size - sizeof(*receive))) {
 		dev_err(dev, "log request wrong size %d vs %zu\n", len,
-				(op->request->payload_size - sizeof(*receive)));
+			(op->request->payload_size - sizeof(*receive)));
 		return -EINVAL;
 	}
 	if (len == 0) {

drivers/staging/greybus/log.c static int gb_log_probe(struct gb_bundle *bundle, · line 89

Quoted 8 lines
drivers/staging/greybus/log.c +1 -1
@@ -83,7 +83,7 @@ static int gb_log_probe(struct gb_bundle *bundle,
 		return -ENOMEM;
 
 	connection = gb_connection_create(bundle, le16_to_cpu(cport_desc->id),
-			gb_log_request_handler);
+					  gb_log_request_handler);
 	if (IS_ERR(connection)) {
 		retval = PTR_ERR(connection);
 		goto error_free;
Signature · 1 line
viresh
Acked-by on v1 6/9
#17 lore raw

Re: [greybus-dev] [PATCH 6/9] staging: greybus: loopback: Fix up some alignment checkpatch issues

In reply to Greg Kroah-Hartman
Quoted 27 lines · Greg Kroah-Hartman

Some function prototypes do not match the expected alignment formatting so fix that up so that checkpatch is happy.

---
 drivers/staging/greybus/loopback.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/loopback.c +1 -1
index 48d85ebe404a..b0ab0eed5c18 100644
@@ -882,7 +882,7 @@ static int gb_loopback_fn(void *data)
 				gb->type = 0;
 				gb->send_count = 0;
 				sysfs_notify(&gb->dev->kobj,  NULL,
-						"iteration_count");
+					     "iteration_count");
 				dev_dbg(&bundle->dev, "load test complete\n");
 			} else {
 				dev_dbg(&bundle->dev,

drivers/staging/greybus/loopback.c static int gb_loopback_probe(struct gb_bundle *bundle, · line 1060

Quoted 8 lines
drivers/staging/greybus/loopback.c +1 -1
@@ -1054,7 +1054,7 @@ static int gb_loopback_probe(struct gb_bundle *bundle,
 
 	/* Allocate kfifo */
 	if (kfifo_alloc(&gb->kfifo_lat, kfifo_depth * sizeof(u32),
-			  GFP_KERNEL)) {
+			GFP_KERNEL)) {
 		retval = -ENOMEM;
 		goto out_conn;
 	}
Signature · 1 line
viresh
Acked-by on v1 8/9
#22 lore raw

Re: [greybus-dev] [PATCH 8/9] staging: greybus: move the greybus core to drivers/greybus

In reply to Greg Kroah-Hartman
Quoted 11 lines · Greg Kroah-Hartman

The Greybus core code has been stable for a long time, and has been shipping for many years in millions of phones. With the advent of a recent Google Summer of Code project, and a number of new devices in the works from various companies, it is time to get the core greybus code out of staging as it really is going to be with us for a while.

Signature · 1 line
viresh
Acked-by on v1 9/9
#24 lore raw

Re: [greybus-dev] [PATCH 9/9] staging: greybus: move es2 to drivers/greybus/

In reply to Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

The es2 Greybus host controller has long been stable, so move it out of drivers/staging/ to drivers/greybus/

Quoted 10 lines
---
 drivers/greybus/Kconfig              | 16 ++++++++++++++++
 drivers/greybus/Makefile             |  7 +++++++
 drivers/{staging => }/greybus/arpc.h |  0
 drivers/{staging => }/greybus/es2.c  |  2 +-
 drivers/staging/greybus/Kconfig      | 11 -----------
 drivers/staging/greybus/Makefile     |  5 -----
 6 files changed, 24 insertions(+), 17 deletions(-)
 rename drivers/{staging => }/greybus/arpc.h (100%)
 rename drivers/{staging => }/greybus/es2.c (99%)
Signature · 1 line
viresh
author maintainer
#3 lore raw

Re: [PATCH 1/9] staging: greybus: fix up SPDX comment in .h files

In reply to Viresh Kumar
Quoted 29 lines · Viresh Kumar
Quoted 19 lines · Greg Kroah-Hartman

When these files originally got an SPDX tag, I used // instead of /* */ for the .h files. Fix this up to use // properly.

---
 drivers/staging/greybus/firmware.h               | 2 +-
 drivers/staging/greybus/gb-camera.h              | 2 +-
 drivers/staging/greybus/gbphy.h                  | 2 +-
 drivers/staging/greybus/greybus.h                | 2 +-
 drivers/staging/greybus/greybus_authentication.h | 2 +-
 drivers/staging/greybus/greybus_firmware.h       | 2 +-
 drivers/staging/greybus/greybus_manifest.h       | 2 +-
 drivers/staging/greybus/greybus_protocols.h      | 2 +-
 drivers/staging/greybus/greybus_trace.h          | 2 +-
Quoted 8 lines
 drivers/staging/greybus/hd.h                     | 2 +-
 drivers/staging/greybus/interface.h              | 2 +-
 drivers/staging/greybus/manifest.h               | 2 +-
 drivers/staging/greybus/module.h                 | 2 +-
 drivers/staging/greybus/operation.h              | 2 +-
 drivers/staging/greybus/spilib.h                 | 2 +-
 drivers/staging/greybus/svc.h                    | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
Quoted 1 line

Thanks for all of the acks!

greg k-h

#4 lore raw

Re: [PATCH 1/9] staging: greybus: fix up SPDX comment in .h files

Hi Greg,

Quoted 30 lines · Greg Kroah-Hartman
Quoted 29 lines · Viresh Kumar
Quoted 27 lines · Greg Kroah-Hartman

When these files originally got an SPDX tag, I used // instead of /* */ for the .h files. Fix this up to use // properly.

---
 drivers/staging/greybus/firmware.h               | 2 +-
 drivers/staging/greybus/gb-camera.h              | 2 +-
 drivers/staging/greybus/gbphy.h                  | 2 +-
 drivers/staging/greybus/greybus.h                | 2 +-
 drivers/staging/greybus/greybus_authentication.h | 2 +-
 drivers/staging/greybus/greybus_firmware.h       | 2 +-
 drivers/staging/greybus/greybus_manifest.h       | 2 +-
 drivers/staging/greybus/greybus_protocols.h      | 2 +-
 drivers/staging/greybus/greybus_trace.h          | 2 +-
 drivers/staging/greybus/hd.h                     | 2 +-
 drivers/staging/greybus/interface.h              | 2 +-
 drivers/staging/greybus/manifest.h               | 2 +-
 drivers/staging/greybus/module.h                 | 2 +-
 drivers/staging/greybus/operation.h              | 2 +-
 drivers/staging/greybus/spilib.h                 | 2 +-
 drivers/staging/greybus/svc.h                    | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
Quoted 5 lines
Quoted 1 line

Thanks for all of the acks!

greg k-h

I found similar issues of graybus when I tested the latest staging-testing

In file included from <command-line>:0:0:
./include/linux/greybus/greybus_protocols.h:45:2: error: unknown type name ‘__le16’
__le16 size; /* Size in bytes of header + payload */
^~~~~~
./include/linux/greybus/greybus_protocols.h:46:2: error: unknown type name ‘__le16’
__le16 operation_id; /* Operation unique id */
^~~~~~
./include/linux/greybus/greybus_protocols.h:47:2: error: unknown type name ‘__u8’
__u8 type; /* E.g GB_I2C_TYPE_* or GB_GPIO_TYPE_* */
^~~~
./include/linux/greybus/greybus_protocols.h:48:2: error: unknown type name ‘__u8’
__u8 result; /* Result of request (in responses only) */
^~~~
./include/linux/greybus/greybus_protocols.h:49:2: error: unknown type name ‘__u8’
__u8 pad[2]; /* must be zero (ignore when read) */
^~~~
./include/linux/greybus/greybus_protocols.h:58:2: error: unknown type name ‘__u8’
__u8 phase;
^~~~
./include/linux/greybus/greybus_protocols.h:88:2: error: unknown type name ‘__u8’
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:89:2: error: unknown type name ‘__u8’
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:93:2: error: unknown type name ‘__u8’
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:94:2: error: unknown type name ‘__u8’
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:98:2: error: unknown type name ‘__u8’
__u8 bundle_id;
^~~~
./include/linux/greybus/greybus_protocols.h:102:2: error: unknown type name ‘__u8’
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:103:2: error: unknown type name ‘__u8’
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:108:2: error: unknown type name ‘__le16’
__le16 size;
^~~~~~
./include/linux/greybus/greybus_protocols.h:113:2: error: unknown type name ‘__u8’
__u8 data[0];
^~~~
./include/linux/greybus/greybus_protocols.h:118:2: error: unknown type name ‘__le16’
__le16 cport_id;
^~~~~~
./include/linux/greybus/greybus_protocols.h:122:2: error: unknown type name ‘__le16’
__le16 cport_id;

.. and other files...

Not very sure... but it seems it can be observed with allmodconfig or CONFIG_KERNEL_HEADER_TEST=y and fail my compilation... Hope that of some help (kind reminder...)

Thanks,
Gao Xiang

Quoted 4 lines

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Acked-by on the v1 series
#25 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

The Greybus code has long been "stable" but was living in the drivers/staging/ directory to see if there really was going to be devices using this protocol over the long-term. With the success of millions of phones with this hardware and code in it, and the recent Google Summer of Code project, and a number of of new devices in the works from various companies, it is time to finally move this code out of staging into the "real" portion of the kernel so that people know they can rely on it.

Quoted 7 lines

This series first does a little bit of checkpatch cleanups for some basic remaining issues in the greybus files, and then moves the include directory, the greybus core code, and the es2 greybus host controller driver into drivers/greybus.

To come after this is the movement of the Documentation entries and a number of the module drivers that are stable.

They all look good to me. (I don't always agree with checkpatch, but standardization is good.) Thanks Greg.

Quoted 116 lines

Greg Kroah-Hartman (9):
staging: greybus: fix up SPDX comment in .h files
staging: greybus: remove license "boilerplate"
staging: greybus: hd: Fix up some alignment checkpatch issues
staging: greybus: manifest: Fix up some alignment checkpatch issues
staging: greybus: log: Fix up some alignment checkpatch issues
staging: greybus: loopback: Fix up some alignment checkpatch issues
staging: greybus: move core include files to include/linux/greybus/
staging: greybus: move the greybus core to drivers/greybus
staging: greybus: move es2 to drivers/greybus/

 MAINTAINERS                                   |   3 +
 drivers/Kconfig                               |   2 +
 drivers/Makefile                              |   1 +
 drivers/greybus/Kconfig                       |  32 +++++
 drivers/greybus/Makefile                      |  26 +++++
 drivers/greybus/arpc.h                        |  63 ++++++++++
 drivers/{staging => }/greybus/bundle.c        |   2 +-
 drivers/{staging => }/greybus/connection.c    |   2 +-
 drivers/{staging => }/greybus/control.c       |   2 +-
 drivers/{staging => }/greybus/core.c          |   2 +-
 drivers/{staging => }/greybus/debugfs.c       |   3 +-
 drivers/{staging => }/greybus/es2.c           |   3 +-
 drivers/{staging => }/greybus/greybus_trace.h |   2 +-
 drivers/{staging => }/greybus/hd.c            |  12 +-
 drivers/{staging => }/greybus/interface.c     |   2 +-
 drivers/{staging => }/greybus/manifest.c      |  41 ++++---
 drivers/{staging => }/greybus/module.c        |   2 +-
 drivers/{staging => }/greybus/operation.c     |   2 +-
 drivers/{staging => }/greybus/svc.c           |   3 +-
 drivers/{staging => }/greybus/svc_watchdog.c  |   2 +-
 .../Documentation/firmware/authenticate.c     |  46 --------
 .../greybus/Documentation/firmware/firmware.c |  46 --------
 drivers/staging/greybus/Kconfig               |  27 -----
 drivers/staging/greybus/Makefile              |  22 ----
 drivers/staging/greybus/arche-platform.c      |   2 +-
 drivers/staging/greybus/arpc.h                | 109 ------------------
 drivers/staging/greybus/audio_apbridgea.c     |   3 +-
 drivers/staging/greybus/audio_apbridgea.h     |  26 +----
 drivers/staging/greybus/audio_codec.h         |   4 +-
 drivers/staging/greybus/audio_gb.c            |   4 +-
 drivers/staging/greybus/authentication.c      |   3 +-
 drivers/staging/greybus/bootrom.c             |   2 +-
 drivers/staging/greybus/camera.c              |   2 +-
 drivers/staging/greybus/firmware.h            |   4 +-
 drivers/staging/greybus/fw-core.c             |   2 +-
 drivers/staging/greybus/fw-download.c         |   2 +-
 drivers/staging/greybus/fw-management.c       |   2 +-
 drivers/staging/greybus/gb-camera.h           |   2 +-
 drivers/staging/greybus/gbphy.c               |   2 +-
 drivers/staging/greybus/gbphy.h               |   2 +-
 drivers/staging/greybus/gpio.c                |   2 +-
 .../staging/greybus/greybus_authentication.h  |  48 +-------
 drivers/staging/greybus/greybus_firmware.h    |  48 +-------
 drivers/staging/greybus/hid.c                 |   3 +-
 drivers/staging/greybus/i2c.c                 |   2 +-
 drivers/staging/greybus/light.c               |   4 +-
 drivers/staging/greybus/log.c                 |   9 +-
 drivers/staging/greybus/loopback.c            |   9 +-
 drivers/staging/greybus/power_supply.c        |   3 +-
 drivers/staging/greybus/pwm.c                 |   2 +-
 drivers/staging/greybus/raw.c                 |   3 +-
 drivers/staging/greybus/sdio.c                |   2 +-
 drivers/staging/greybus/spi.c                 |   2 +-
 drivers/staging/greybus/spilib.c              |   2 +-
 drivers/staging/greybus/spilib.h              |   2 +-
 drivers/staging/greybus/tools/loopback_test.c |   2 -
 drivers/staging/greybus/uart.c                |   2 +-
 drivers/staging/greybus/usb.c                 |   2 +-
 drivers/staging/greybus/vibrator.c            |   3 +-
 .../greybus => include/linux}/greybus.h       |  26 ++---
 .../linux}/greybus/bundle.h                   |   0
 .../linux}/greybus/connection.h               |   0
 .../linux}/greybus/control.h                  |   0
 .../linux}/greybus/greybus_id.h               |   0
 .../linux}/greybus/greybus_manifest.h         |   2 +-
 .../linux}/greybus/greybus_protocols.h        |  48 +-------
 .../staging => include/linux}/greybus/hd.h    |   2 +-
 .../linux}/greybus/interface.h                |   2 +-
 .../linux}/greybus/manifest.h                 |   2 +-
 .../linux}/greybus/module.h                   |   2 +-
 .../linux}/greybus/operation.h                |   2 +-
 .../staging => include/linux}/greybus/svc.h   |   2 +-
 72 files changed, 225 insertions(+), 532 deletions(-)
 create mode 100644 drivers/greybus/Kconfig
 create mode 100644 drivers/greybus/Makefile
 create mode 100644 drivers/greybus/arpc.h
 rename drivers/{staging => }/greybus/bundle.c (99%)
 rename drivers/{staging => }/greybus/connection.c (99%)
 rename drivers/{staging => }/greybus/control.c (99%)
 rename drivers/{staging => }/greybus/core.c (99%)
 rename drivers/{staging => }/greybus/debugfs.c (94%)
 rename drivers/{staging => }/greybus/es2.c (99%)
 rename drivers/{staging => }/greybus/greybus_trace.h (99%)
 rename drivers/{staging => }/greybus/hd.c (96%)
 rename drivers/{staging => }/greybus/interface.c (99%)
 rename drivers/{staging => }/greybus/manifest.c (95%)
 rename drivers/{staging => }/greybus/module.c (99%)
 rename drivers/{staging => }/greybus/operation.c (99%)
 rename drivers/{staging => }/greybus/svc.c (99%)
 rename drivers/{staging => }/greybus/svc_watchdog.c (99%)
 delete mode 100644 drivers/staging/greybus/arpc.h
 rename {drivers/staging/greybus => include/linux}/greybus.h (88%)
 rename {drivers/staging => include/linux}/greybus/bundle.h (100%)
 rename {drivers/staging => include/linux}/greybus/connection.h (100%)
 rename {drivers/staging => include/linux}/greybus/control.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_id.h (100%)
 rename {drivers/staging => include/linux}/greybus/greybus_manifest.h (99%)
 rename {drivers/staging => include/linux}/greybus/greybus_protocols.h (96%)
 rename {drivers/staging => include/linux}/greybus/hd.h (98%)
 rename {drivers/staging => include/linux}/greybus/interface.h (98%)
 rename {drivers/staging => include/linux}/greybus/manifest.h (87%)
 rename {drivers/staging => include/linux}/greybus/module.h (94%)
 rename {drivers/staging => include/linux}/greybus/operation.h (99%)
 rename {drivers/staging => include/linux}/greybus/svc.h (98%)
#26 lore raw
In reply to Greg Kroah-Hartman

I can't compile greybus so it's hard to run Smatch on it... I have a Smatch thing which ignores missing includes and just tries its best. It mostly generates garbage output but a couple of these look like potential issues:

drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()' drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed

regards,
dan carpenter

author maintainer
#27 lore raw
Quoted 4 lines · Dan Carpenter

I can't compile greybus so it's hard to run Smatch on it... I have a Smatch thing which ignores missing includes and just tries its best. It mostly generates garbage output but a couple of these look like potential issues:

Why can't you compile the code?

Quoted 1 line

drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()'

That should be checked on line 368, right?

Quoted 2 lines

drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed

I don't understand this warning, how are these potentially double freed?

And the light.c file isn't moving out of drivers/staging/ just yet :)

thanks,

greg k-h

maintainer
#28 lore raw

Hi,

Quoted 8 lines · Greg Kroah-Hartman
Quoted 4 lines · Dan Carpenter

I can't compile greybus so it's hard to run Smatch on it... I have a Smatch thing which ignores missing includes and just tries its best. It mostly generates garbage output but a couple of these look like potential issues:

Why can't you compile the code?

I think we are missing includes in some of the
greybus header files.

Quoted 12 lines
Quoted 2 lines

drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()'

That should be checked on line 368, right?

Quoted 2 lines

drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed

I don't understand this warning, how are these potentially double freed?

And the light.c file isn't moving out of drivers/staging/ just yet :)

I will take a look at this also.

Cheers,
Rui

#32 lore raw
In reply to Greg Kroah-Hartman
Quoted 2 lines · Greg Kroah-Hartman

Why can't you compile the code?

Now that I try to investigate the compile errors, it starts to compile perfectly...

Quoted 3 lines
Quoted 1 line

drivers/staging/greybus/operation.c:379 gb_operation_message_alloc() warn: check 'message_size' for integer overflows 'kzalloc()'

That should be checked on line 368, right?

This is a false positive. I assumed it was related to the compile problem...

Quoted 5 lines
Quoted 3 lines

drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->channels' double freed drivers/staging/greybus/light.c:1256 gb_lights_request_handler() warn: 'light->name' double freed

I don't understand this warning, how are these potentially double freed?

I will fix these.

regards,
dan carpenter

maintainer Acked-by on v1 2/9
#9 lore raw

Re: [PATCH 2/9] staging: greybus: remove license "boilerplate"

In reply to Greg Kroah-Hartman
Quoted 13 lines · Greg Kroah-Hartman

When the greybus drivers were converted to SPDX identifiers for the license text, some license boilerplate was not removed. Clean this up by removing this unneeded text now.

Cc Johan Hovold <[email protected]>
Cc Alex Elder <[email protected]>
Cc Vaibhav Agarwal <[email protected]>
Cc Mark Greer <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc "Bryan O'Donoghue" <[email protected]>
Quoted 1 line

---

maintainer Acked-by on v1 7/9
#20 lore raw

Re: [PATCH 7/9] staging: greybus: move core include files to include/linux/greybus/

In reply to Greg Kroah-Hartman
Quoted 16 lines · Greg Kroah-Hartman

With the goal of moving the core of the greybus code out of staging, the include files need to be moved to include/linux/greybus.h and include/linux/greybus/

Cc Vaibhav Hiremath <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Alex Elder <[email protected]>
Cc Vaibhav Agarwal <[email protected]>
Cc Mark Greer <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Rui Miguel Silva <[email protected]>
Cc David Lin <[email protected]>
Cc "Bryan O'Donoghue" <[email protected]>
Quoted 1 line

---

#29 lore raw
In reply to Rui Miguel Silva
Quoted 8 lines · Rui Miguel Silva

Hi,

Quoted 6 lines · Greg Kroah-Hartman
Quoted 4 lines · Dan Carpenter

I can't compile greybus so it's hard to run Smatch on it... I have a Smatch thing which ignores missing includes and just tries its best. It mostly generates garbage output but a couple of these look like potential issues:

Quoted 5 lines
Quoted 2 lines

Why can't you compile the code?

I think we are missing includes in some of the
greybus header files.

Really? Where? Builds fine here and passes 0-day :)

thanks,

greg k-h

author maintainer
#5 lore raw

Re: [PATCH 1/9] staging: greybus: fix up SPDX comment in .h files

In reply to Gao Xiang
Quoted 93 lines · Gao Xiang

Hi Greg,

Quoted 30 lines · Greg Kroah-Hartman
Quoted 29 lines · Viresh Kumar
Quoted 27 lines · Greg Kroah-Hartman

When these files originally got an SPDX tag, I used // instead of /* */ for the .h files. Fix this up to use // properly.

---
 drivers/staging/greybus/firmware.h               | 2 +-
 drivers/staging/greybus/gb-camera.h              | 2 +-
 drivers/staging/greybus/gbphy.h                  | 2 +-
 drivers/staging/greybus/greybus.h                | 2 +-
 drivers/staging/greybus/greybus_authentication.h | 2 +-
 drivers/staging/greybus/greybus_firmware.h       | 2 +-
 drivers/staging/greybus/greybus_manifest.h       | 2 +-
 drivers/staging/greybus/greybus_protocols.h      | 2 +-
 drivers/staging/greybus/greybus_trace.h          | 2 +-
 drivers/staging/greybus/hd.h                     | 2 +-
 drivers/staging/greybus/interface.h              | 2 +-
 drivers/staging/greybus/manifest.h               | 2 +-
 drivers/staging/greybus/module.h                 | 2 +-
 drivers/staging/greybus/operation.h              | 2 +-
 drivers/staging/greybus/spilib.h                 | 2 +-
 drivers/staging/greybus/svc.h                    | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
Quoted 5 lines
Quoted 1 line

Thanks for all of the acks!

greg k-h

I found similar issues of graybus when I tested the latest staging-testing

In file included from <command-line>:0:0:
./include/linux/greybus/greybus_protocols.h:45:2: error: unknown type name ‘__le16’
__le16 size; /* Size in bytes of header + payload */
^~~~~~
./include/linux/greybus/greybus_protocols.h:46:2: error: unknown type name ‘__le16’
__le16 operation_id; /* Operation unique id */
^~~~~~
./include/linux/greybus/greybus_protocols.h:47:2: error: unknown type name ‘__u8’
__u8 type; /* E.g GB_I2C_TYPE_* or GB_GPIO_TYPE_* */
^~~~
./include/linux/greybus/greybus_protocols.h:48:2: error: unknown type name ‘__u8’
__u8 result; /* Result of request (in responses only) */
^~~~
./include/linux/greybus/greybus_protocols.h:49:2: error: unknown type name ‘__u8’
__u8 pad[2]; /* must be zero (ignore when read) */
^~~~
./include/linux/greybus/greybus_protocols.h:58:2: error: unknown type name ‘__u8’
__u8 phase;
^~~~
./include/linux/greybus/greybus_protocols.h:88:2: error: unknown type name ‘__u8’
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:89:2: error: unknown type name ‘__u8’
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:93:2: error: unknown type name ‘__u8’
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:94:2: error: unknown type name ‘__u8’
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:98:2: error: unknown type name ‘__u8’
__u8 bundle_id;
^~~~
./include/linux/greybus/greybus_protocols.h:102:2: error: unknown type name ‘__u8’
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:103:2: error: unknown type name ‘__u8’
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:108:2: error: unknown type name ‘__le16’
__le16 size;
^~~~~~
./include/linux/greybus/greybus_protocols.h:113:2: error: unknown type name ‘__u8’
__u8 data[0];
^~~~
./include/linux/greybus/greybus_protocols.h:118:2: error: unknown type name ‘__le16’
__le16 cport_id;
^~~~~~
./include/linux/greybus/greybus_protocols.h:122:2: error: unknown type name ‘__le16’
__le16 cport_id;

Quoted 5 lines

.. and other files...

Not very sure... but it seems it can be observed with allmodconfig or CONFIG_KERNEL_HEADER_TEST=y and fail my compilation... Hope that of some help (kind reminder...)

Ah, thank you so much for this, NOW that makes sense why I got that odd kbuild warning that I could not figure out.

Let me go fix this up, thank you so much.

greg k-h

maintainer
#30 lore raw
In reply to Greg KH

Hi Greg,

Quoted 9 lines · Greg KH
Quoted 8 lines · Rui Miguel Silva

Hi,

Quoted 6 lines · Greg Kroah-Hartman
Quoted 4 lines · Dan Carpenter

I can't compile greybus so it's hard to run Smatch on it... I have a Smatch thing which ignores missing includes and just tries its best. It mostly generates garbage output but a couple of these look like potential issues:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Why can't you compile the code?

I think we are missing includes in some of the
greybus header files.

Really? Where? Builds fine here and passes 0-day :)

Yeah; just sent a patch to fix it.

Cheers,
Rui

#6 lore raw

Re: [PATCH 1/9] staging: greybus: fix up SPDX comment in .h files

In reply to Greg Kroah-Hartman
Quoted 94 lines · Greg Kroah-Hartman
Quoted 93 lines · Gao Xiang

Hi Greg,

Quoted 30 lines · Greg Kroah-Hartman
Quoted 29 lines · Viresh Kumar
Quoted 27 lines · Greg Kroah-Hartman

When these files originally got an SPDX tag, I used // instead of /* */ for the .h files. Fix this up to use // properly.

---
 drivers/staging/greybus/firmware.h               | 2 +-
 drivers/staging/greybus/gb-camera.h              | 2 +-
 drivers/staging/greybus/gbphy.h                  | 2 +-
 drivers/staging/greybus/greybus.h                | 2 +-
 drivers/staging/greybus/greybus_authentication.h | 2 +-
 drivers/staging/greybus/greybus_firmware.h       | 2 +-
 drivers/staging/greybus/greybus_manifest.h       | 2 +-
 drivers/staging/greybus/greybus_protocols.h      | 2 +-
 drivers/staging/greybus/greybus_trace.h          | 2 +-
 drivers/staging/greybus/hd.h                     | 2 +-
 drivers/staging/greybus/interface.h              | 2 +-
 drivers/staging/greybus/manifest.h               | 2 +-
 drivers/staging/greybus/module.h                 | 2 +-
 drivers/staging/greybus/operation.h              | 2 +-
 drivers/staging/greybus/spilib.h                 | 2 +-
 drivers/staging/greybus/svc.h                    | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)
Quoted 5 lines
Quoted 1 line

Thanks for all of the acks!

greg k-h

I found similar issues of graybus when I tested the latest staging-testing

In file included from <command-line>:0:0:
./include/linux/greybus/greybus_protocols.h:45:2: error: unknown type name ??????_le16??????
__le16 size; /* Size in bytes of header + payload */
^~~~~~
./include/linux/greybus/greybus_protocols.h:46:2: error: unknown type name ??????_le16??????
__le16 operation_id; /* Operation unique id */
^~~~~~
./include/linux/greybus/greybus_protocols.h:47:2: error: unknown type name ??????_u8??????
__u8 type; /* E.g GB_I2C_TYPE_* or GB_GPIO_TYPE_* */
^~~~
./include/linux/greybus/greybus_protocols.h:48:2: error: unknown type name ??????_u8??????
__u8 result; /* Result of request (in responses only) */
^~~~
./include/linux/greybus/greybus_protocols.h:49:2: error: unknown type name ??????_u8??????
__u8 pad[2]; /* must be zero (ignore when read) */
^~~~
./include/linux/greybus/greybus_protocols.h:58:2: error: unknown type name ??????_u8??????
__u8 phase;
^~~~
./include/linux/greybus/greybus_protocols.h:88:2: error: unknown type name ??????_u8??????
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:89:2: error: unknown type name ??????_u8??????
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:93:2: error: unknown type name ??????_u8??????
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:94:2: error: unknown type name ??????_u8??????
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:98:2: error: unknown type name ??????_u8??????
__u8 bundle_id;
^~~~
./include/linux/greybus/greybus_protocols.h:102:2: error: unknown type name ??????_u8??????
__u8 major;
^~~~
./include/linux/greybus/greybus_protocols.h:103:2: error: unknown type name ??????_u8??????
__u8 minor;
^~~~
./include/linux/greybus/greybus_protocols.h:108:2: error: unknown type name ??????_le16??????
__le16 size;
^~~~~~
./include/linux/greybus/greybus_protocols.h:113:2: error: unknown type name ??????_u8??????
__u8 data[0];
^~~~
./include/linux/greybus/greybus_protocols.h:118:2: error: unknown type name ??????_le16??????
__le16 cport_id;
^~~~~~
./include/linux/greybus/greybus_protocols.h:122:2: error: unknown type name ??????_le16??????
__le16 cport_id;

Quoted 8 lines
Quoted 5 lines

.. and other files...

Not very sure... but it seems it can be observed with allmodconfig or CONFIG_KERNEL_HEADER_TEST=y and fail my compilation... Hope that of some help (kind reminder...)

Ah, thank you so much for this, NOW that makes sense why I got that odd kbuild warning that I could not figure out.

Yeah, it seems KERNEL_HEADER_TEST is a new feature which aims at ensuring kernel headers are self-contained... I think it can be observed by
CONFIG_GREYBUS and CONFIG_KERNEL_HEADER_TEST are on

see commit 43c78d88036e ("kbuild: compile-test kernel headers to ensure they are self-contained")

Quoted 2 lines

Let me go fix this up, thank you so much.

You're welcome, I was just testing my previous patch after merging as well...

Thanks,
Gao Xiang

Quoted 2 lines

greg k-h

#31 lore raw
In reply to Rui Miguel Silva
Quoted 14 lines · Rui Miguel Silva

Hi Greg,

Quoted 12 lines · Greg KH
Quoted 11 lines · Rui Miguel Silva

Hi,

Quoted 8 lines · Greg Kroah-Hartman
Quoted 4 lines · Dan Carpenter

I can't compile greybus so it's hard to run Smatch on it... I have a Smatch thing which ignores missing includes and just tries its best. It mostly generates garbage output but a couple of these look like potential issues:

Why can't you compile the code?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I think we are missing includes in some of the
greybus header files.

Really? Where? Builds fine here and passes 0-day :)

Yeah; just sent a patch to fix it.

Thanks, now merged!

greg k-h

#33 lore raw
In reply to Greg Kroah-Hartman

Hi!

Quoted 4 lines

The Greybus code has long been "stable" but was living in the drivers/staging/ directory to see if there really was going to be devices using this protocol over the long-term. With the success of millions of phones with this hardware and code in it, and the recent

So, what phones do have this, for example?

Does that mean that there's large choice of phones well supported by the mainline?

Best regards, Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
author maintainer
#34 lore raw
Quoted 8 lines · Pavel Machek

Hi!

Quoted 4 lines

The Greybus code has long been "stable" but was living in the drivers/staging/ directory to see if there really was going to be devices using this protocol over the long-term. With the success of millions of phones with this hardware and code in it, and the recent

So, what phones do have this, for example?

The Motorola Z line, all of the "Moto Mods" use this interface to communicate.

Quoted 2 lines

Does that mean that there's large choice of phones well supported by the mainline?

I have no idea what kernel version they use, you will have to talk to Motorola about that.

greg k-h