From: Axel Lin Date: Mon, 8 Aug 2011 09:17:18 +0000 (+0800) Subject: platform-drivers-x86: asus-laptop: fix wrong test for successful registered led_classdev X-Git-Tag: v3.2-rc1~111^2~24 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fcf71aa0032acbd30b3222f9cb238919ab3b984;p=pandora-kernel.git platform-drivers-x86: asus-laptop: fix wrong test for successful registered led_classdev device_create returns &struct device pointer on success, or ERR_PTR() on error. Thus if led_classdev_register fails, led_cdev->dev is always not NULL. Thus to unregister a successful registered led_classdev, we should check IS_ERR_OR_NULL macro for led_cdev->dev instead of checking if led_cdev->dev is NULL or not. we use IS_ERR_OR_NULL instead of IS_ERR because if we havn't call led_classdev_register, the led_cdev->dev is NULL. Signed-off-by: Axel Lin Acked-by: Corentin Chary Signed-off-by: Matthew Garrett --- Reading git-diff-tree failed