From d9d16e16a3f82e88fec99222c9c7e26563b05688 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 7 Nov 2017 17:30:05 +0100 Subject: kobject: add SPDX identifiers to all kobject files It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the kobject files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Signed-off-by: Greg Kroah-Hartman --- include/linux/kobject.h | 1 + include/linux/kobject_ns.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e0a6205caa71..ac59b67f131e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * kobject.h - generic kernel object infrastructure. * diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h index df32d2508290..7dd22132cc13 100644 --- a/include/linux/kobject_ns.h +++ b/include/linux/kobject_ns.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* Kernel object name space definitions * * Copyright (c) 2002-2003 Patrick Mochel -- cgit v1.2.3 From 045c5f75b77177ad19fe747e33aae2249a12e827 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 7 Nov 2017 17:30:06 +0100 Subject: kobject: Remove redundant license text Now that the SPDX tag is in all kobject files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Signed-off-by: Greg Kroah-Hartman --- include/linux/kobject.h | 2 -- include/linux/kobject_ns.h | 2 -- lib/kobject.c | 3 --- lib/kobject_uevent.c | 2 -- samples/kobject/kobject-example.c | 3 --- samples/kobject/kset-example.c | 3 --- 6 files changed, 15 deletions(-) (limited to 'include/linux') diff --git a/include/linux/kobject.h b/include/linux/kobject.h index ac59b67f131e..7f6f93c3df9c 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -7,8 +7,6 @@ * Copyright (c) 2006-2008 Greg Kroah-Hartman * Copyright (c) 2006-2008 Novell Inc. * - * This file is released under the GPLv2. - * * Please read Documentation/kobject.txt before using the kobject * interface, ESPECIALLY the parts about reference counts and object * destructors. diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h index 7dd22132cc13..069aa2ebef90 100644 --- a/include/linux/kobject_ns.h +++ b/include/linux/kobject_ns.h @@ -8,8 +8,6 @@ * * Split from kobject.h by David Howells (dhowells@redhat.com) * - * This file is released under the GPLv2. - * * Please read Documentation/kobject.txt before using the kobject * interface, ESPECIALLY the parts about reference counts and object * destructors. diff --git a/lib/kobject.c b/lib/kobject.c index 450e771d0ac7..fad12300d264 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -6,9 +6,6 @@ * Copyright (c) 2006-2007 Greg Kroah-Hartman * Copyright (c) 2006-2007 Novell Inc. * - * This file is released under the GPLv2. - * - * * Please see the file Documentation/kobject.txt for critical information * about using the kobject interface. */ diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index bbedaf359a1e..cc7e2c46273b 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -6,8 +6,6 @@ * Copyright (C) 2004 Novell, Inc. All rights reserved. * Copyright (C) 2004 IBM, Inc. All rights reserved. * - * Licensed under the GNU GPL v2. - * * Authors: * Robert Love * Kay Sievers diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c index 6cc8bb36a4e8..9e383fdbaa00 100644 --- a/samples/kobject/kobject-example.c +++ b/samples/kobject/kobject-example.c @@ -4,9 +4,6 @@ * * Copyright (C) 2004-2007 Greg Kroah-Hartman * Copyright (C) 2007 Novell Inc. - * - * Released under the GPL version 2 only. - * */ #include #include diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index 58543eca7f16..401328fd687d 100644 --- a/samples/kobject/kset-example.c +++ b/samples/kobject/kset-example.c @@ -4,9 +4,6 @@ * * Copyright (C) 2004-2007 Greg Kroah-Hartman * Copyright (C) 2007 Novell Inc. - * - * Released under the GPL version 2 only. - * */ #include #include -- cgit v1.2.3 From 989d42e85dc2f6823f39b8e9d080fd04bae0645d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 7 Nov 2017 17:30:07 +0100 Subject: driver core: add SPDX identifiers to all driver core files It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the driver core files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Johannes Berg Cc: "Luis R. Rodriguez" Cc: William Breathitt Gray Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Signed-off-by: Greg Kroah-Hartman --- drivers/base/attribute_container.c | 1 + drivers/base/bus.c | 1 + drivers/base/cacheinfo.c | 1 + drivers/base/class.c | 1 + drivers/base/component.c | 1 + drivers/base/container.c | 1 + drivers/base/core.c | 1 + drivers/base/cpu.c | 1 + drivers/base/dd.c | 1 + drivers/base/devcoredump.c | 1 + drivers/base/devres.c | 1 + drivers/base/dma-contiguous.c | 1 + drivers/base/dma-mapping.c | 1 + drivers/base/driver.c | 1 + drivers/base/firmware.c | 1 + drivers/base/firmware_class.c | 1 + drivers/base/hypervisor.c | 1 + drivers/base/init.c | 1 + drivers/base/isa.c | 1 + drivers/base/map.c | 1 + drivers/base/module.c | 1 + drivers/base/pinctrl.c | 1 + drivers/base/platform-msi.c | 1 + drivers/base/platform.c | 1 + drivers/base/property.c | 1 + drivers/base/soc.c | 1 + drivers/base/syscore.c | 1 + drivers/base/test/test_async_driver_probe.c | 1 + drivers/base/topology.c | 1 + drivers/base/transport_class.c | 1 + include/linux/device.h | 1 + 31 files changed, 31 insertions(+) (limited to 'include/linux') diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 95e3ef82f3b7..218b9deb4f0b 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * attribute_container.c - implementation of a simple container for classes * diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 22a64fd3309b..46ddb96b9179 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * bus.c - bus driver management * diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index eb3af2739537..e321a7e66a1d 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * cacheinfo support - processor cache information via sysfs * diff --git a/drivers/base/class.c b/drivers/base/class.c index 52eb8e644acd..61220ea83f8e 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * class.c - basic device class management * diff --git a/drivers/base/component.c b/drivers/base/component.c index 89b032f2ffd2..c96ed8068719 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Componentized device handling. * diff --git a/drivers/base/container.c b/drivers/base/container.c index ecbfbe2e908f..ddc68a1e10af 100644 --- a/drivers/base/container.c +++ b/drivers/base/container.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * System bus type for containers. * diff --git a/drivers/base/core.c b/drivers/base/core.c index 110230d86527..aa0593f1c2b6 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * drivers/base/core.c - core driver model code (device registration, etc) * diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 58a9b608d821..31d0ee53613b 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * CPU subsystem support */ diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 2c964f56dafe..47ac37838399 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * drivers/base/dd.c - The core device/driver interactions. * diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c index 7be310f7db73..3133684a8754 100644 --- a/drivers/base/devcoredump.c +++ b/drivers/base/devcoredump.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This file is provided under the GPLv2 license. * diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 71d577025285..1b7a9a8cbd6a 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * drivers/base/devres.c - device resource management * diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index ea9726e71468..7c954100d503 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Contiguous Memory Allocator for DMA mapping framework * Copyright (c) 2010-2011 by Samsung Electronics. diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c index e584eddef0a7..c7e7806a657f 100644 --- a/drivers/base/dma-mapping.c +++ b/drivers/base/dma-mapping.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * drivers/base/dma-mapping.c - arch-independent dma-mapping routines * diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 4eabfe28d2b3..6a93c7522dbe 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * driver.c - centralized device driver management * diff --git a/drivers/base/firmware.c b/drivers/base/firmware.c index 113815556809..0ef2a36de65e 100644 --- a/drivers/base/firmware.c +++ b/drivers/base/firmware.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * firmware.c - firmware subsystem hoohaw. * diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 43b97a8137f7..7dd36ace6152 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * firmware_class.c - Multi purpose firmware loading support * diff --git a/drivers/base/hypervisor.c b/drivers/base/hypervisor.c index 4f8b741f4615..8dbd98c7ed55 100644 --- a/drivers/base/hypervisor.c +++ b/drivers/base/hypervisor.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * hypervisor.c - /sys/hypervisor subsystem. * diff --git a/drivers/base/init.c b/drivers/base/init.c index 48c0e220acc0..0bf84b9e09b2 100644 --- a/drivers/base/init.c +++ b/drivers/base/init.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs diff --git a/drivers/base/isa.c b/drivers/base/isa.c index cd6ccdcf9df0..61ab202aae43 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ISA bus. */ diff --git a/drivers/base/map.c b/drivers/base/map.c index c1d38234d725..07daaf6c2cd6 100644 --- a/drivers/base/map.c +++ b/drivers/base/map.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * linux/drivers/base/map.c * diff --git a/drivers/base/module.c b/drivers/base/module.c index 2a215780eda2..9e50e55c547a 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * module.c - module sysfs fun for drivers * diff --git a/drivers/base/pinctrl.c b/drivers/base/pinctrl.c index eb929dd6ef1e..fec06a1a0e15 100644 --- a/drivers/base/pinctrl.c +++ b/drivers/base/pinctrl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver core interface to the pinctrl subsystem. * diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c index e5473525e7b2..d7c56d5b06e0 100644 --- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * MSI framework for platform devices * diff --git a/drivers/base/platform.c b/drivers/base/platform.c index c203fb90c1a0..be287c7f5a6a 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * platform.c - platform 'pseudo' bus for legacy devices * diff --git a/drivers/base/property.c b/drivers/base/property.c index 851b1b6596a4..f64bf6bebf58 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * property.c - Unified device property interface. * diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 909dedae4c4e..b1e6e7ca46f0 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) ST-Ericsson SA 2011 * diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c index 8d98a329f6ea..34f71a46b51c 100644 --- a/drivers/base/syscore.c +++ b/drivers/base/syscore.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * syscore.c - Execution of system core operations. * diff --git a/drivers/base/test/test_async_driver_probe.c b/drivers/base/test/test_async_driver_probe.c index a3355d66bc12..58b445ed8d8b 100644 --- a/drivers/base/test/test_async_driver_probe.c +++ b/drivers/base/test/test_async_driver_probe.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2014 Google, Inc. * diff --git a/drivers/base/topology.c b/drivers/base/topology.c index d936fcf9f1fb..5abc176a2966 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * driver/base/topology.c - Populate sysfs with cpu topology information * diff --git a/drivers/base/transport_class.c b/drivers/base/transport_class.c index f6c453c3816e..750378341a43 100644 --- a/drivers/base/transport_class.c +++ b/drivers/base/transport_class.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * transport_class.c - implementation of generic transport classes * using attribute_containers diff --git a/include/linux/device.h b/include/linux/device.h index 9d32000725da..70d352f9083a 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * device.h - generic, centralized driver model * -- cgit v1.2.3 From 328257099077e8affd438c179d8a938948de2e7f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 7 Nov 2017 17:30:09 +0100 Subject: driver core: Remove redundant license text Now that the SPDX tag is in all driver core files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Johannes Berg Cc: "Luis R. Rodriguez" Signed-off-by: Greg Kroah-Hartman --- drivers/base/attribute_container.c | 2 -- drivers/base/bus.c | 3 --- drivers/base/cacheinfo.c | 12 ------------ drivers/base/class.c | 3 --- drivers/base/component.c | 4 ---- drivers/base/container.c | 4 ---- drivers/base/core.c | 3 --- drivers/base/dd.c | 2 -- drivers/base/devcoredump.c | 16 ---------------- drivers/base/devres.c | 2 -- drivers/base/dma-contiguous.c | 5 ----- drivers/base/dma-mapping.c | 2 -- drivers/base/driver.c | 3 --- drivers/base/firmware.c | 2 -- drivers/base/hypervisor.c | 2 -- drivers/base/init.c | 2 -- drivers/base/map.c | 1 - drivers/base/module.c | 3 --- drivers/base/pinctrl.c | 2 -- drivers/base/platform-msi.c | 12 ------------ drivers/base/platform.c | 2 -- drivers/base/property.c | 4 ---- drivers/base/soc.c | 1 - drivers/base/syscore.c | 2 -- drivers/base/test/test_async_driver_probe.c | 9 --------- drivers/base/topology.c | 16 ---------------- drivers/base/transport_class.c | 2 -- include/linux/device.h | 2 -- 28 files changed, 123 deletions(-) (limited to 'include/linux') diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 218b9deb4f0b..20736aaa0e69 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c @@ -4,8 +4,6 @@ * * Copyright (c) 2005 - James Bottomley * - * This file is licensed under GPLv2 - * * The basic idea here is to enable a device to be attached to an * aritrary numer of classes without having to allocate storage for them. * Instead, the contained classes select the devices they need to attach diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 46ddb96b9179..6c63e1abbdcc 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -6,9 +6,6 @@ * Copyright (c) 2002-3 Open Source Development Labs * Copyright (c) 2007 Greg Kroah-Hartman * Copyright (c) 2007 Novell Inc. - * - * This file is released under the GPLv2 - * */ #include diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index e321a7e66a1d..6e1000bff481 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -4,18 +4,6 @@ * * Based on arch/x86/kernel/cpu/intel_cacheinfo.c * Author: Sudeep Holla - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/base/class.c b/drivers/base/class.c index 61220ea83f8e..54def4e02f00 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -6,9 +6,6 @@ * Copyright (c) 2002-3 Open Source Development Labs * Copyright (c) 2003-2004 Greg Kroah-Hartman * Copyright (c) 2003-2004 IBM Corp. - * - * This file is released under the GPLv2 - * */ #include diff --git a/drivers/base/component.c b/drivers/base/component.c index c96ed8068719..891f0e38647c 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -2,10 +2,6 @@ /* * Componentized device handling. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * * This is work in progress. We gather up the component devices into a list, * and bind them when instructed. At the moment, we're specific to the DRM * subsystem, and only handles one master device, but this doesn't have to be diff --git a/drivers/base/container.c b/drivers/base/container.c index ddc68a1e10af..1ba42d2d3532 100644 --- a/drivers/base/container.c +++ b/drivers/base/container.c @@ -4,10 +4,6 @@ * * Copyright (C) 2013, Intel Corporation * Author: Rafael J. Wysocki - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include diff --git a/drivers/base/core.c b/drivers/base/core.c index aa0593f1c2b6..bf45587bcb46 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -6,9 +6,6 @@ * Copyright (c) 2002-3 Open Source Development Labs * Copyright (c) 2006 Greg Kroah-Hartman * Copyright (c) 2006 Novell, Inc. - * - * This file is released under the GPLv2 - * */ #include diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 47ac37838399..533c82f55cea 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -14,8 +14,6 @@ * Copyright (c) 2002-3 Open Source Development Labs * Copyright (c) 2007-2009 Greg Kroah-Hartman * Copyright (c) 2007-2009 Novell Inc. - * - * This file is released under the GPLv2 */ #include diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c index 3133684a8754..f1a3353f3494 100644 --- a/drivers/base/devcoredump.c +++ b/drivers/base/devcoredump.c @@ -1,24 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 /* - * This file is provided under the GPLv2 license. - * - * GPL LICENSE SUMMARY - * * Copyright(c) 2014 Intel Mobile Communications GmbH * Copyright(c) 2015 Intel Deutschland GmbH * - * 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 for more details. - * - * The full GNU General Public License is included in this distribution - * in the file called COPYING. - * * Contact Information: * Intel Linux Wireless * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 1b7a9a8cbd6a..95b67281cd2a 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -4,8 +4,6 @@ * * Copyright (c) 2006 SUSE Linux Products GmbH * Copyright (c) 2006 Tejun Heo - * - * This file is released under the GPLv2. */ #include diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index 7c954100d503..d987dcd1bd56 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -5,11 +5,6 @@ * Written by: * Marek Szyprowski * Michal Nazarewicz - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License or (at your optional) any later version of the license. */ #define pr_fmt(fmt) "cma: " fmt diff --git a/drivers/base/dma-mapping.c b/drivers/base/dma-mapping.c index c7e7806a657f..3b118353ea17 100644 --- a/drivers/base/dma-mapping.c +++ b/drivers/base/dma-mapping.c @@ -4,8 +4,6 @@ * * Copyright (c) 2006 SUSE Linux Products GmbH * Copyright (c) 2006 Tejun Heo - * - * This file is released under the GPLv2. */ #include diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 6a93c7522dbe..4e20d68edb0d 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -6,9 +6,6 @@ * Copyright (c) 2002-3 Open Source Development Labs * Copyright (c) 2007 Greg Kroah-Hartman * Copyright (c) 2007 Novell Inc. - * - * This file is released under the GPLv2 - * */ #include diff --git a/drivers/base/firmware.c b/drivers/base/firmware.c index 0ef2a36de65e..8dff940e0db9 100644 --- a/drivers/base/firmware.c +++ b/drivers/base/firmware.c @@ -6,8 +6,6 @@ * Copyright (c) 2002-3 Open Source Development Labs * Copyright (c) 2007 Greg Kroah-Hartman * Copyright (c) 2007 Novell Inc. - * - * This file is released under the GPLv2 */ #include #include diff --git a/drivers/base/hypervisor.c b/drivers/base/hypervisor.c index 8dbd98c7ed55..1ce59b4b53ce 100644 --- a/drivers/base/hypervisor.c +++ b/drivers/base/hypervisor.c @@ -5,8 +5,6 @@ * Copyright (C) IBM Corp. 2006 * Copyright (C) 2007 Greg Kroah-Hartman * Copyright (C) 2007 Novell Inc. - * - * This file is released under the GPLv2 */ #include diff --git a/drivers/base/init.c b/drivers/base/init.c index 0bf84b9e09b2..dd85b05a6a16 100644 --- a/drivers/base/init.c +++ b/drivers/base/init.c @@ -2,8 +2,6 @@ /* * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs - * - * This file is released under the GPLv2 */ #include diff --git a/drivers/base/map.c b/drivers/base/map.c index 07daaf6c2cd6..5650ab2b247a 100644 --- a/drivers/base/map.c +++ b/drivers/base/map.c @@ -3,7 +3,6 @@ * linux/drivers/base/map.c * * (C) Copyright Al Viro 2002,2003 - * Released under GPL v2. * * NOTE: data structure needs to be changed. It works, but for large dev_t * it will be too slow. It is isolated, though, so these changes will be diff --git a/drivers/base/module.c b/drivers/base/module.c index 9e50e55c547a..46ad4d636731 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c @@ -1,9 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* * module.c - module sysfs fun for drivers - * - * This file is released under the GPLv2 - * */ #include #include diff --git a/drivers/base/pinctrl.c b/drivers/base/pinctrl.c index fec06a1a0e15..c22864458511 100644 --- a/drivers/base/pinctrl.c +++ b/drivers/base/pinctrl.c @@ -7,8 +7,6 @@ * Based on bits of regulator core, gpio core and clk core * * Author: Linus Walleij - * - * License terms: GNU General Public License (GPL) version 2 */ #include diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c index d7c56d5b06e0..8e22073aeeed 100644 --- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c @@ -4,18 +4,6 @@ * * Copyright (C) 2015 ARM Limited, All Rights Reserved. * Author: Marc Zyngier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include diff --git a/drivers/base/platform.c b/drivers/base/platform.c index be287c7f5a6a..f1bf7b38d91c 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -5,8 +5,6 @@ * Copyright (c) 2002-3 Patrick Mochel * Copyright (c) 2002-3 Open Source Development Labs * - * This file is released under the GPLv2 - * * Please see Documentation/driver-model/platform.txt for more * information. */ diff --git a/drivers/base/property.c b/drivers/base/property.c index f64bf6bebf58..1ddf769ab8f7 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -5,10 +5,6 @@ * Copyright (C) 2014, Intel Corporation * Authors: Rafael J. Wysocki * Mika Westerberg - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include diff --git a/drivers/base/soc.c b/drivers/base/soc.c index b1e6e7ca46f0..4e80f48ad5d6 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -3,7 +3,6 @@ * Copyright (C) ST-Ericsson SA 2011 * * Author: Lee Jones for ST-Ericsson. - * License terms: GNU General Public License (GPL), version 2 */ #include diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c index 34f71a46b51c..6e076f359dcc 100644 --- a/drivers/base/syscore.c +++ b/drivers/base/syscore.c @@ -3,8 +3,6 @@ * syscore.c - Execution of system core operations. * * Copyright (C) 2011 Rafael J. Wysocki , Novell Inc. - * - * This file is released under the GPLv2. */ #include diff --git a/drivers/base/test/test_async_driver_probe.c b/drivers/base/test/test_async_driver_probe.c index 58b445ed8d8b..e7f145d662f0 100644 --- a/drivers/base/test/test_async_driver_probe.c +++ b/drivers/base/test/test_async_driver_probe.c @@ -1,15 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2014 Google, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/base/topology.c b/drivers/base/topology.c index 5abc176a2966..5fd9f167ecc1 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c @@ -7,22 +7,6 @@ * Copyright (C) 2006, Intel Corp. * * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * */ #include #include diff --git a/drivers/base/transport_class.c b/drivers/base/transport_class.c index 750378341a43..5ed86ded6e6b 100644 --- a/drivers/base/transport_class.c +++ b/drivers/base/transport_class.c @@ -5,8 +5,6 @@ * * Copyright (c) 2005 - James Bottomley * - * This file is licensed under GPLv2 - * * The basic idea here is to allow any "device controller" (which * would most often be a Host Bus Adapter to use the services of one * or more tranport classes for performing transport specific diff --git a/include/linux/device.h b/include/linux/device.h index 70d352f9083a..46cece519fb9 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -6,8 +6,6 @@ * Copyright (c) 2004-2009 Greg Kroah-Hartman * Copyright (c) 2008-2009 Novell Inc. * - * This file is released under the GPLv2 - * * See Documentation/driver-model/ for more information. */ -- cgit v1.2.3 From 353c6ddaa963d453dc56ced2f3cbfd9bd57409c7 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 19 Dec 2017 10:15:06 -0800 Subject: sysfs.h: Use octal permissions Use the more common and preferred octal directly. Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- include/linux/sysfs.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'include/linux') diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 40839c02d28c..b8bfdc173ec0 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -113,7 +113,7 @@ struct attribute_group { } #define __ATTR_RO(_name) { \ - .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ + .attr = { .name = __stringify(_name), .mode = 0444 }, \ .show = _name##_show, \ } @@ -124,12 +124,11 @@ struct attribute_group { } #define __ATTR_WO(_name) { \ - .attr = { .name = __stringify(_name), .mode = S_IWUSR }, \ + .attr = { .name = __stringify(_name), .mode = 0200 }, \ .store = _name##_store, \ } -#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ - _name##_show, _name##_store) +#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store) #define __ATTR_NULL { .attr = { .name = NULL } } @@ -192,14 +191,13 @@ struct bin_attribute { } #define __BIN_ATTR_RO(_name, _size) { \ - .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ + .attr = { .name = __stringify(_name), .mode = 0444 }, \ .read = _name##_read, \ .size = _size, \ } -#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \ - (S_IWUSR | S_IRUGO), _name##_read, \ - _name##_write, _size) +#define __BIN_ATTR_RW(_name, _size) \ + __BIN_ATTR(_name, 0644, _name##_read, _name##_write, _size) #define __BIN_ATTR_NULL __ATTR_NULL -- cgit v1.2.3 From 3c47d19ff4dccf1500c33bcbe3b5bc804907a0da Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 11 Jan 2018 09:36:38 +0100 Subject: drivers: base: add coredump driver ops This adds the coredump driver operation. When the driver defines it a coredump file is added in the sysfs folder of the device upon driver binding. The file is removed when the driver is unbound. User-space can trigger a coredump for this device by echo'ing to the coredump file. Signed-off-by: Arend van Spriel Signed-off-by: Greg Kroah-Hartman --- drivers/base/dd.c | 40 +++++++++++++++++++++++++++++++++------- include/linux/device.h | 2 +- 2 files changed, 34 insertions(+), 8 deletions(-) (limited to 'include/linux') diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 533c82f55cea..de6fd092bf2f 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -288,6 +288,18 @@ static void driver_bound(struct device *dev) kobject_uevent(&dev->kobj, KOBJ_BIND); } +static ssize_t coredump_store(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + device_lock(dev); + if (dev->driver->coredump) + dev->driver->coredump(dev); + device_unlock(dev); + + return count; +} +static DEVICE_ATTR_WO(coredump); + static int driver_sysfs_add(struct device *dev) { int ret; @@ -297,14 +309,26 @@ static int driver_sysfs_add(struct device *dev) BUS_NOTIFY_BIND_DRIVER, dev); ret = sysfs_create_link(&dev->driver->p->kobj, &dev->kobj, + kobject_name(&dev->kobj)); + if (ret) + goto fail; + + ret = sysfs_create_link(&dev->kobj, &dev->driver->p->kobj, + "driver"); + if (ret) + goto rm_dev; + + if (!IS_ENABLED(CONFIG_DEV_COREDUMP) || !dev->driver->coredump || + !device_create_file(dev, &dev_attr_coredump)) + return 0; + + sysfs_remove_link(&dev->kobj, "driver"); + +rm_dev: + sysfs_remove_link(&dev->driver->p->kobj, kobject_name(&dev->kobj)); - if (ret == 0) { - ret = sysfs_create_link(&dev->kobj, &dev->driver->p->kobj, - "driver"); - if (ret) - sysfs_remove_link(&dev->driver->p->kobj, - kobject_name(&dev->kobj)); - } + +fail: return ret; } @@ -313,6 +337,8 @@ static void driver_sysfs_remove(struct device *dev) struct device_driver *drv = dev->driver; if (drv) { + if (drv->coredump) + device_remove_file(dev, &dev_attr_coredump); sysfs_remove_link(&drv->p->kobj, kobject_name(&dev->kobj)); sysfs_remove_link(&dev->kobj, "driver"); } diff --git a/include/linux/device.h b/include/linux/device.h index 46cece519fb9..cd3b47e271b4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -287,6 +287,7 @@ struct device_driver { const struct attribute_group **groups; const struct dev_pm_ops *pm; + int (*coredump) (struct device *dev); struct driver_private *p; }; @@ -300,7 +301,6 @@ extern struct device_driver *driver_find(const char *name, extern int driver_probe_done(void); extern void wait_for_device_probe(void); - /* sysfs interface for exporting driver attributes */ struct driver_attribute { -- cgit v1.2.3 From c505cbd45f6e9c539d57dd171d95ec7e5e9f9cd0 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 22 Jan 2018 18:01:42 +0200 Subject: device property: Define type of PROPERTY_ENRTY_*() macros Some of the drivers may use the macro at runtime flow, like struct property_entry p[10]; ... p[index++] = PROPERTY_ENTRY_U8("u8 property", u8_data); In that case and absence of the data type compiler fails the build: drivers/char/ipmi/ipmi_dmi.c:79:29: error: Expected ; at end of statement drivers/char/ipmi/ipmi_dmi.c:79:29: error: got { Acked-by: Corey Minyard Cc: Corey Minyard Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- include/linux/property.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/linux') diff --git a/include/linux/property.h b/include/linux/property.h index f6189a3ac63c..2e3a7c24659e 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -206,7 +206,7 @@ struct property_entry { */ #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ -{ \ +(struct property_entry) { \ .name = _name_, \ .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ .is_array = true, \ @@ -224,7 +224,7 @@ struct property_entry { PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) #define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ -{ \ +(struct property_entry) { \ .name = _name_, \ .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ .is_array = true, \ @@ -233,7 +233,7 @@ struct property_entry { } #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ -{ \ +(struct property_entry) { \ .name = _name_, \ .length = sizeof(_type_), \ .is_string = false, \ @@ -250,7 +250,7 @@ struct property_entry { PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) #define PROPERTY_ENTRY_STRING(_name_, _val_) \ -{ \ +(struct property_entry) { \ .name = _name_, \ .length = sizeof(_val_), \ .is_string = true, \ @@ -258,7 +258,7 @@ struct property_entry { } #define PROPERTY_ENTRY_BOOL(_name_) \ -{ \ +(struct property_entry) { \ .name = _name_, \ } -- cgit v1.2.3