]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: intel_pmc_core: do not create a static struct device
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 18:48:03 +0000 (20:48 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 24 Sep 2020 11:05:21 +0000 (14:05 +0300)
commit5c2cc8b31540968efe128863ac2497a54cc47019
tree7b7e02f01dd6da7c3e2e4cce30ad133997ddd7b8
parentca956c28eb7fc9f295ce82bbf1fb53cca935267c
platform/x86: intel_pmc_core: do not create a static struct device

A struct device is a dynamic structure, with reference counting.
"Tricking" the kernel to make a dynamic structure static, by working
around the driver core release detection logic, is not nice.

Because of this, this code has been used as an example for others on
"how to do things", which is just about the worst thing possible to have
happen.

Fix this all up by making the platform device dynamic and providing a
real release function.

Cc: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Cc: Vishwanath Somayaji <vishwanath.somayaji@intel.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andy Shevchenko <andy@infradead.org>
Cc: Rajat Jain <rajatja@google.com>
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reported-by: Maximilian Luz <luzmaximilian@gmail.com>
Fixes: 9e08657209a3 ("platform/x86: intel_pmc_core: Attach using APCI HID "INT33A1"")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Rajat Jain <rajatja@google.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel_pmc_core_pltdrv.c