Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754807AbbLVQS5 (ORCPT ); Tue, 22 Dec 2015 11:18:57 -0500 Received: from m50-138.163.com ([123.125.50.138]:39110 "EHLO m50-138.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbbLVQSz (ORCPT ); Tue, 22 Dec 2015 11:18:55 -0500 From: Geliang Tang To: Mark Brown Cc: Geliang Tang , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] spi: use to_spi_device Date: Wed, 23 Dec 2015 00:18:41 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: C9GowAAntsTld3lW6z9aAg--.5407S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1xAF48Gw1fZr4fZr4fKrg_yoW3GFb_ur 1jvr4xWrWFy3WxJFy3Kr4fAr9IgF4FgrWkKFn7tFZ5tFsxXFy7ZryDur17tryUur4DCFn8 XFnxX34UurWfGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUdHUPUUUUU== X-Originating-IP: [116.77.132.150] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiowfYmVUL3hmWWwAAsx Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1004 Lines: 30 Use to_spi_device() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/spi/spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 19659c4..2ae1588 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -84,8 +84,7 @@ static ssize_t spi_device_##field##_show(struct device *dev, \ struct device_attribute *attr, \ char *buf) \ { \ - struct spi_device *spi = container_of(dev, \ - struct spi_device, dev); \ + struct spi_device *spi = to_spi_device(dev); \ return spi_statistics_##field##_show(&spi->statistics, buf); \ } \ static struct device_attribute dev_attr_spi_device_##field = { \ -- 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/