Re: [PATCH] compal-laptop: Replace sysfs support with rfkill support

From: Alan Jenkins
Date: Sat Aug 22 2009 - 07:20:41 EST


On 8/21/09, Mario Limonciello <Mario_Limonciello@xxxxxxxx> wrote:
> This drops the support for manually groking the files in sysfs
> to turn on and off the WLAN and BT for Compal laptops in favor
> of platform rfkill support.
>
> It has been combined into a single patch to not introduce regressions
> in the process of simply adding rfkill support.
>
> Signed-off-by: Mario Limonciello <Mario_Limonciello@xxxxxxxx>

> @@ -390,23 +314,19 @@ static int __init compal_init(void)
>
> ret = platform_device_add(compal_device);
> if (ret)
> - goto fail_platform_device1;
> + goto fail_platform_device;
>
> - ret = sysfs_create_group(&compal_device->dev.kobj,
> - &compal_attribute_group);
> + ret = setup_rfkill();
> if (ret)
> - goto fail_platform_device2;
> + goto fail_rfkill;
>
> printk(KERN_INFO "compal-laptop: driver "COMPAL_DRIVER_VERSION
> " successfully loaded.\n");
>
> return 0;
>
> -fail_platform_device2:
> -
> - platform_device_del(compal_device);
> -
> -fail_platform_device1:
> +fail_rfkill:
> +fail_platform_device:
>
> platform_device_put(compal_device);
>

I guess our mails crossed. As in the previous patch I think
platform_device_del() should still be called, in the fail_rfkill case.

Previously platform_device_del() was required after
platform_device_add(), if we bailed out because of a failure in
sysfs_create_group(). I don't think that requirement is removed by
replacing sysfs_create_group() with setup_rfkill().

Regards
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/