summaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/Kconfig2
-rw-r--r--drivers/macintosh/adb.c10
-rw-r--r--drivers/macintosh/macio-adb.c24
-rw-r--r--drivers/macintosh/macio_asic.c2
-rw-r--r--drivers/macintosh/rack-meter.c4
-rw-r--r--drivers/macintosh/therm_windtunnel.c8
-rw-r--r--drivers/macintosh/via-pmu-backlight.c1
-rw-r--r--drivers/macintosh/windfarm_pm112.c6
-rw-r--r--drivers/macintosh/windfarm_pm121.c5
-rw-r--r--drivers/macintosh/windfarm_pm72.c7
-rw-r--r--drivers/macintosh/windfarm_pm81.c8
-rw-r--r--drivers/macintosh/windfarm_pm91.c8
-rw-r--r--drivers/macintosh/windfarm_rm31.c7
13 files changed, 37 insertions, 55 deletions
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index a0e717a986..fb38f68444 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -262,7 +262,7 @@ config SENSORS_AMS
will be called ams.
config SENSORS_AMS_PMU
- bool "PMU variant"
+ bool "PMU variant" if SENSORS_AMS_I2C
depends on SENSORS_AMS && ADB_PMU
default y
help
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 057b0221f6..b0407c5fad 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -74,7 +74,9 @@ static struct adb_driver *adb_driver_list[] = {
NULL
};
-static struct class *adb_dev_class;
+static const struct class adb_dev_class = {
+ .name = "adb",
+};
static struct adb_driver *adb_controller;
BLOCKING_NOTIFIER_HEAD(adb_client_list);
@@ -888,10 +890,10 @@ adbdev_init(void)
return;
}
- adb_dev_class = class_create("adb");
- if (IS_ERR(adb_dev_class))
+ if (class_register(&adb_dev_class))
return;
- device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
+
+ device_create(&adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
platform_device_register(&adb_pfdev);
platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index 779f126828..19c63959eb 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -83,35 +83,32 @@ struct adb_driver macio_adb_driver = {
int macio_probe(void)
{
- struct device_node *np;
+ struct device_node *np __free(device_node) =
+ of_find_compatible_node(NULL, "adb", "chrp,adb0");
- np = of_find_compatible_node(NULL, "adb", "chrp,adb0");
- if (np) {
- of_node_put(np);
+ if (np)
return 0;
- }
+
return -ENODEV;
}
int macio_init(void)
{
- struct device_node *adbs;
+ struct device_node *adbs __free(device_node) =
+ of_find_compatible_node(NULL, "adb", "chrp,adb0");
struct resource r;
unsigned int irq;
- adbs = of_find_compatible_node(NULL, "adb", "chrp,adb0");
if (!adbs)
return -ENXIO;
- if (of_address_to_resource(adbs, 0, &r)) {
- of_node_put(adbs);
+ if (of_address_to_resource(adbs, 0, &r))
return -ENXIO;
- }
+
adb = ioremap(r.start, sizeof(struct adb_regs));
- if (!adb) {
- of_node_put(adbs);
+ if (!adb)
return -ENOMEM;
- }
+
out_8(&adb->ctrl.r, 0);
out_8(&adb->intr.r, 0);
@@ -121,7 +118,6 @@ int macio_init(void)
out_8(&adb->autopoll.r, APE);
irq = irq_of_parse_and_map(adbs, 0);
- of_node_put(adbs);
if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) {
iounmap(adb);
printk(KERN_ERR "ADB: can't get irq %d\n", irq);
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index a5ee8f736a..565f1e21ff 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -136,7 +136,7 @@ static int macio_device_modalias(const struct device *dev, struct kobj_uevent_en
extern const struct attribute_group *macio_dev_groups[];
-struct bus_type macio_bus_type = {
+const struct bus_type macio_bus_type = {
.name = "macio",
.match = macio_bus_match,
.uevent = macio_device_modalias,
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c
index 40240bce77..896a43bd81 100644
--- a/drivers/macintosh/rack-meter.c
+++ b/drivers/macintosh/rack-meter.c
@@ -523,7 +523,7 @@ static int rackmeter_probe(struct macio_dev* mdev,
return rc;
}
-static int rackmeter_remove(struct macio_dev* mdev)
+static void rackmeter_remove(struct macio_dev *mdev)
{
struct rackmeter *rm = dev_get_drvdata(&mdev->ofdev.dev);
@@ -558,8 +558,6 @@ static int rackmeter_remove(struct macio_dev* mdev)
/* Get rid of me */
kfree(rm);
-
- return 0;
}
static int rackmeter_shutdown(struct macio_dev* mdev)
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index 3c1b29476c..2576a53f24 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -481,11 +481,9 @@ static int therm_of_probe(struct platform_device *dev)
return -ENODEV;
}
-static int
-therm_of_remove( struct platform_device *dev )
+static void therm_of_remove(struct platform_device *dev)
{
i2c_del_driver( &g4fan_driver );
- return 0;
}
static const struct of_device_id therm_of_match[] = {{
@@ -501,7 +499,7 @@ static struct platform_driver therm_of_driver = {
.of_match_table = therm_of_match,
},
.probe = therm_of_probe,
- .remove = therm_of_remove,
+ .remove_new = therm_of_remove,
};
struct apple_thermal_info {
@@ -551,7 +549,7 @@ g4fan_exit( void )
platform_driver_unregister( &therm_of_driver );
if( x.of_dev )
- of_device_unregister( x.of_dev );
+ of_platform_device_destroy(&x.of_dev->dev, NULL);
}
module_init(g4fan_init);
diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c
index c2d87e7fa8..89450645c2 100644
--- a/drivers/macintosh/via-pmu-backlight.c
+++ b/drivers/macintosh/via-pmu-backlight.c
@@ -10,6 +10,7 @@
#include <asm/ptrace.h>
#include <linux/adb.h>
+#include <linux/backlight.h>
#include <linux/pmu.h>
#include <asm/backlight.h>
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c
index d1dec314ae..876b4d8cbe 100644
--- a/drivers/macintosh/windfarm_pm112.c
+++ b/drivers/macintosh/windfarm_pm112.c
@@ -662,16 +662,14 @@ static int wf_pm112_probe(struct platform_device *dev)
return 0;
}
-static int wf_pm112_remove(struct platform_device *dev)
+static void wf_pm112_remove(struct platform_device *dev)
{
wf_unregister_client(&pm112_events);
- /* should release all sensors and controls */
- return 0;
}
static struct platform_driver wf_pm112_driver = {
.probe = wf_pm112_probe,
- .remove = wf_pm112_remove,
+ .remove_new = wf_pm112_remove,
.driver = {
.name = "windfarm",
},
diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh/windfarm_pm121.c
index 82500417eb..cd45fbc4fe 100644
--- a/drivers/macintosh/windfarm_pm121.c
+++ b/drivers/macintosh/windfarm_pm121.c
@@ -992,15 +992,14 @@ static int pm121_probe(struct platform_device *ddev)
return 0;
}
-static int pm121_remove(struct platform_device *ddev)
+static void pm121_remove(struct platform_device *ddev)
{
wf_unregister_client(&pm121_events);
- return 0;
}
static struct platform_driver pm121_driver = {
.probe = pm121_probe,
- .remove = pm121_remove,
+ .remove_new = pm121_remove,
.driver = {
.name = "windfarm",
.bus = &platform_bus_type,
diff --git a/drivers/macintosh/windfarm_pm72.c b/drivers/macintosh/windfarm_pm72.c
index e21f973551..14fa1e9ac3 100644
--- a/drivers/macintosh/windfarm_pm72.c
+++ b/drivers/macintosh/windfarm_pm72.c
@@ -775,17 +775,14 @@ static int wf_pm72_probe(struct platform_device *dev)
return 0;
}
-static int wf_pm72_remove(struct platform_device *dev)
+static void wf_pm72_remove(struct platform_device *dev)
{
wf_unregister_client(&pm72_events);
-
- /* should release all sensors and controls */
- return 0;
}
static struct platform_driver wf_pm72_driver = {
.probe = wf_pm72_probe,
- .remove = wf_pm72_remove,
+ .remove_new = wf_pm72_remove,
.driver = {
.name = "windfarm",
},
diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c
index 257fb2c695..404d2454e3 100644
--- a/drivers/macintosh/windfarm_pm81.c
+++ b/drivers/macintosh/windfarm_pm81.c
@@ -724,7 +724,7 @@ static int wf_smu_probe(struct platform_device *ddev)
return 0;
}
-static int wf_smu_remove(struct platform_device *ddev)
+static void wf_smu_remove(struct platform_device *ddev)
{
wf_unregister_client(&wf_smu_events);
@@ -761,13 +761,11 @@ static int wf_smu_remove(struct platform_device *ddev)
/* Destroy control loops state structures */
kfree(wf_smu_sys_fans);
kfree(wf_smu_cpu_fans);
-
- return 0;
}
static struct platform_driver wf_smu_driver = {
- .probe = wf_smu_probe,
- .remove = wf_smu_remove,
+ .probe = wf_smu_probe,
+ .remove_new = wf_smu_remove,
.driver = {
.name = "windfarm",
},
diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c
index 120a9cfba0..fba02a3754 100644
--- a/drivers/macintosh/windfarm_pm91.c
+++ b/drivers/macintosh/windfarm_pm91.c
@@ -647,7 +647,7 @@ static int wf_smu_probe(struct platform_device *ddev)
return 0;
}
-static int wf_smu_remove(struct platform_device *ddev)
+static void wf_smu_remove(struct platform_device *ddev)
{
wf_unregister_client(&wf_smu_events);
@@ -691,13 +691,11 @@ static int wf_smu_remove(struct platform_device *ddev)
kfree(wf_smu_slots_fans);
kfree(wf_smu_drive_fans);
kfree(wf_smu_cpu_fans);
-
- return 0;
}
static struct platform_driver wf_smu_driver = {
- .probe = wf_smu_probe,
- .remove = wf_smu_remove,
+ .probe = wf_smu_probe,
+ .remove_new = wf_smu_remove,
.driver = {
.name = "windfarm",
},
diff --git a/drivers/macintosh/windfarm_rm31.c b/drivers/macintosh/windfarm_rm31.c
index e9eb7fdde4..dc8f2c7ef1 100644
--- a/drivers/macintosh/windfarm_rm31.c
+++ b/drivers/macintosh/windfarm_rm31.c
@@ -668,17 +668,14 @@ static int wf_rm31_probe(struct platform_device *dev)
return 0;
}
-static int wf_rm31_remove(struct platform_device *dev)
+static void wf_rm31_remove(struct platform_device *dev)
{
wf_unregister_client(&rm31_events);
-
- /* should release all sensors and controls */
- return 0;
}
static struct platform_driver wf_rm31_driver = {
.probe = wf_rm31_probe,
- .remove = wf_rm31_remove,
+ .remove_new = wf_rm31_remove,
.driver = {
.name = "windfarm",
},