evgeni/tp_smapi — Issue #5: [make patch] hdaps.c is moved in recent kernels
Author: gdamjan
Created: 2011-10-26 04:34:26+00:00
State: open

Since some time (2.6.37?) hdaps.c is in drivers/platform/x86/ and not in drivers/hwmon/

just for reference I've used this patch to the Makefile to "make patch" it'll probably break backward compatibility

```
From 87df6f52ad3c1b71444a78078919a2c2e410de29 Mon Sep 17 00:00:00 2001
From: Damjan Georgievski
Date: Wed, 26 Oct 2011 06:01:44 +0200
Subject: [PATCH 1/2] hdaps.c is moved in recent kernels

Since some time (2.6.38?) hdaps.c is in drivers/platform/x86/ and not in drivers/hwmon/
---
Makefile | 10 +++++-----
hdaps.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 3d4f876..cc59946 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ install: modules
rm -f $(MOD_DIR)/drivers/firmware/{thinkpad_ec,tp_smapi,tp_base}.ko
rm -f $(MOD_DIR)/extra/{thinkpad_ec,tp_smapi,tp_base}.ko
ifeq ($(HDAPS),1)
-	rm -f $(MOD_DIR)/drivers/hwmon/hdaps.ko
+	rm -f $(MOD_DIR)/drivers/platform/x86/hdaps.ko
rm -f $(MOD_DIR)/extra/hdaps.ko
endif
$(MAKE) -C $(KBUILD) M=$(PWD) O=$(KBUILD) modules_install
@@ -98,9 +98,9 @@ patch: $(KSRC)
cd $$TMPDIR &&\
mkdir -p $(ORG)/$(TP_DIR) &&\
mkdir -p $(ORG)/$(IDIR) &&\
-	mkdir -p $(ORG)/drivers/hwmon &&\
+	mkdir -p $(ORG)/drivers/platform/x86 &&\
cp $(KSRC)/$(TP_DIR)/{Kconfig,Makefile} $(ORG)/$(TP_DIR) &&\
-	cp $(KSRC)/drivers/hwmon/{Kconfig,hdaps.c} $(ORG)/drivers/hwmon/ &&\
+	cp $(KSRC)/drivers/platform/x86/{Kconfig,hdaps.c} $(ORG)/drivers/platform/x86/ &&\
cp -r $(ORG) $(NEW) &&\
\
if [ "$(BASE_IN_PATCH)" == 1 ]; then \
@@ -111,8 +111,8 @@ patch: $(KSRC)
; fi &&\
\
if [ "$(HDAPS_IN_PATCH)" == 1 ]; then \
-	cp $(PWD)/hdaps.c $(NEW)/drivers/hwmon/ &&\
-	perl -i -0777 -pe 's/(config SENSORS_HDAPS\n\ttristate [^\n]+\n\tdepends [^\n]+\n)/$$1\tselect THINKPAD_EC\n/' $(NEW)/drivers/hwmon/Kconfig \
+	cp $(PWD)/hdaps.c $(NEW)/drivers/platform/x86/ &&\
+	perl -i -0777 -pe 's/(config SENSORS_HDAPS\n\ttristate [^\n]+\n\tdepends [^\n]+\n)/$$1\tselect THINKPAD_EC\n/' $(NEW)/drivers/platform/x86/Kconfig \
; fi &&\
\
if [ "$(SMAPI_IN_PATCH)" == 1 ]; then \
diff --git a/hdaps.c b/hdaps.c
index 59ed481..c37d784 100644
--- a/hdaps.c
+++ b/hdaps.c
@@ -1,5 +1,5 @@
/*
- * drivers/hwmon/hdaps.c - driver for IBM's Hard Drive Active Protection System
+ * drivers/platform/x86/hdaps.c - driver for IBM's Hard Drive Active Protection System
*
* Copyright (C) 2005 Robert Love
* Copyright (C) 2005 Jesper Juhl
--
1.7.7.1

```