Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729AbbL0NR4 (ORCPT ); Sun, 27 Dec 2015 08:17:56 -0500 Received: from m50-135.163.com ([123.125.50.135]:42617 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752547AbbL0NRv (ORCPT ); Sun, 27 Dec 2015 08:17:51 -0500 From: Geliang Tang To: Olof Johansson Cc: Geliang Tang , linux-kernel@vger.kernel.org Subject: [PATCH 07/10] platform/chrome: use to_platform_device() Date: Sun, 27 Dec 2015 21:15:45 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: D9GowACXZXbD5H9Wt7t9Bw--.6337S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1xAF48GFWrAr45Jr1DKFg_yoWfZFX_Cw 4I9F48Gr95Krs7Kryqyrn3uF9rtrZYqFs8JrySva4Iq345X34DZ39FvwsrKFWDuF18Zrn8 Ww4Dur4fCFy3AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUlfO3UUUUU== X-Originating-IP: [116.77.145.148] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiNQTdmVSILDy5CwAAsL Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 30 Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/platform/chrome/cros_ec_lightbar.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c index ff76405..a79fb86 100644 --- a/drivers/platform/chrome/cros_ec_lightbar.c +++ b/drivers/platform/chrome/cros_ec_lightbar.c @@ -412,8 +412,7 @@ static umode_t cros_ec_lightbar_attrs_are_visible(struct kobject *kobj, struct device *dev = container_of(kobj, struct device, kobj); struct cros_ec_dev *ec = container_of(dev, struct cros_ec_dev, class_dev); - struct platform_device *pdev = container_of(ec->dev, - struct platform_device, dev); + struct platform_device *pdev = to_platform_device(ec->dev); if (pdev->id != 0) return 0; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/