platform/x86: x86-android-tablets: Pass struct device to init()
authorHans de Goede <hdegoede@redhat.com>
Thu, 9 May 2024 14:12:05 +0000 (16:12 +0200)
committerHans de Goede <hdegoede@redhat.com>
Tue, 14 May 2024 09:43:40 +0000 (11:43 +0200)
Pass a struct device pointer for x86_android_tablet_device to the board
specific init() functions, so that these functions can use this for
e.g. devm_*() functions.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240509141207.63570-1-hdegoede@redhat.com
drivers/platform/x86/x86-android-tablets/core.c
drivers/platform/x86/x86-android-tablets/lenovo.c
drivers/platform/x86/x86-android-tablets/other.c
drivers/platform/x86/x86-android-tablets/x86-android-tablets.h

index 9bb10eadb6994392200e138d490857bb64f4b4f6..919ef447122958056373d790d2a88c3f711cfff3 100644 (file)
@@ -341,7 +341,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev)
                gpiod_add_lookup_table(gpiod_lookup_tables[i]);
 
        if (dev_info->init) {
-               ret = dev_info->init();
+               ret = dev_info->init(&pdev->dev);
                if (ret < 0) {
                        x86_android_tablet_remove(pdev);
                        return ret;
index 16fa04d604a09388e210ef1b3aadb51e279c6fe1..74f39b658d2ccdeabdd6cc838d024a26d51df698 100644 (file)
@@ -230,7 +230,7 @@ static struct gpiod_lookup_table * const lenovo_yb1_x90_gpios[] = {
        NULL
 };
 
-static int __init lenovo_yb1_x90_init(void)
+static int __init lenovo_yb1_x90_init(struct device *dev)
 {
        /* Enable the regulators used by the touchscreens */
 
@@ -412,7 +412,7 @@ static struct gpiod_lookup_table * const lenovo_yoga_tab2_830_1050_gpios[] = {
        NULL
 };
 
-static int __init lenovo_yoga_tab2_830_1050_init(void);
+static int __init lenovo_yoga_tab2_830_1050_init(struct device *dev);
 static void lenovo_yoga_tab2_830_1050_exit(void);
 
 const struct x86_dev_info lenovo_yoga_tab2_830_1050_info __initconst = {
@@ -534,7 +534,7 @@ static int lenovo_yoga_tab2_830_1050_power_off(struct sys_off_data *data)
        return NOTIFY_DONE;
 }
 
-static int __init lenovo_yoga_tab2_830_1050_init(void)
+static int __init lenovo_yoga_tab2_830_1050_init(struct device *dev)
 {
        int ret;
 
@@ -731,7 +731,7 @@ const char * const lenovo_yoga_tab2_1380_modules[] __initconst = {
        NULL
 };
 
-static int __init lenovo_yoga_tab2_1380_init(void)
+static int __init lenovo_yoga_tab2_1380_init(struct device *dev)
 {
        int ret;
 
@@ -978,7 +978,7 @@ static const struct x86_spi_dev_info lenovo_yt3_spi_devs[] __initconst = {
        }
 };
 
-static int __init lenovo_yt3_init(void)
+static int __init lenovo_yt3_init(struct device *dev)
 {
        int ret;
 
index ce487b3c972cb02ffa268db598a8927f96f80c1a..19f3100861d672b4cad9329af30f5e8c3e0a33a9 100644 (file)
@@ -183,7 +183,7 @@ static const struct x86_i2c_client_info chuwi_hi8_i2c_clients[] __initconst = {
        },
 };
 
-static int __init chuwi_hi8_init(void)
+static int __init chuwi_hi8_init(struct device *dev)
 {
        /*
         * Avoid the acpi_unregister_gsi() call in x86_acpi_irq_helper_get()
@@ -244,7 +244,7 @@ const struct x86_dev_info cyberbook_t116_info __initconst = {
 #define CZC_EC_EXTRA_PORT      0x68
 #define CZC_EC_ANDROID_KEYS    0x63
 
-static int __init czc_p10t_init(void)
+static int __init czc_p10t_init(struct device *dev)
 {
        /*
         * The device boots up in "Windows 7" mode, when the home button sends a
@@ -662,7 +662,7 @@ static const struct software_node *ktd2026_node_group[] = {
        NULL
 };
 
-static int __init xiaomi_mipad2_init(void)
+static int __init xiaomi_mipad2_init(struct device *dev)
 {
        return software_node_register_node_group(ktd2026_node_group);
 }
index 821dc094b025439cdb7bd995e29c90167125981e..86402b9b46a338c6f7afc22af66d23ec86e8d8b6 100644 (file)
@@ -89,7 +89,7 @@ struct x86_dev_info {
        int pdev_count;
        int serdev_count;
        int gpio_button_count;
-       int (*init)(void);
+       int (*init)(struct device *dev);
        void (*exit)(void);
 };