Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3277294imu; Fri, 18 Jan 2019 07:44:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN7uivRiyiFr6WXJNLHzLmevn8MG+fpb09/f2NvU1l9YoIQfXdZ+WA2H5iMiEIgK8XvBYUA9 X-Received: by 2002:a63:70c:: with SMTP id 12mr17650769pgh.352.1547826257189; Fri, 18 Jan 2019 07:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547826257; cv=none; d=google.com; s=arc-20160816; b=t5X8qMFy9crEF1UuV/6NMxbN5vtXUUpb4Wu2c3t7al/ELUYfKuUjqhAlO8zUPFvwBT bMXQIAqLfAUO8kg3hoDLDKhI9IPSLxRcZi5J5qJJ8ekmH4islL58RzGmYBJdmwUbldSu 06xxHzjtuLLaiYYkLmayogeFZ0mLmUgYhRJzy628q0yS+G5rhbwj/jovMUkJtdzPLRTB gPnMo9+PFdca2niOcyvQIhAd3LIfpOGnK9kp/eOJondcTCBJBOZCuQ4nKadqQhgCszOE x1HhSvdsPOZiGBeuDJ08bZUKQ7L+6v8Vo4ZTkDR2bTsWhF7UQV2kzQHBIvkQqQLPe25o NsMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=rBG/968C+NmU4EzymnBfXwfXjzHkCG7MP+a/jtsuVGY=; b=0vt8iZ4byQsIhvtF0+lHLfOjidvVltcpCnOvCq6U9HIrVXYp8VQbFKQyowTHlxc2h2 X7uUGbvV16VE5LqfzdBnO7TKtvvR6cJSMHObiwqOtv4PABy4djGbjqkvPIjCVkkdH8RS WU2lk/z4NmyqxVKH2MarE0eXYC6q7mXBQCflzlHHrb5JNA+916sxY32Po1OQ499gjhWF VKFsi+gGGPy9SBVu4ZsxoGLPeaKc9splj/ROK1Dokzs/G07rZhz1YIUVRq77ggM9zoMs 6hg+JwZHk0SjvY9hJnDLrCmtGLc3P38k5fTkVyiDcnZ1afd+uZ8zQXHAEcwti/Vx1aL9 BIpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si5346457pgr.500.2019.01.18.07.43.58; Fri, 18 Jan 2019 07:44:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727710AbfAROiw (ORCPT + 99 others); Fri, 18 Jan 2019 09:38:52 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:54910 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727624AbfAROiv (ORCPT ); Fri, 18 Jan 2019 09:38:51 -0500 Received: from ramsan ([84.194.111.163]) by andre.telenet-ops.be with bizsmtp id Rqen1z00H3XaVaC01qencT; Fri, 18 Jan 2019 15:38:49 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gkVIF-0007kw-4O; Fri, 18 Jan 2019 15:38:47 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gkUm1-0007bf-Eo; Fri, 18 Jan 2019 15:05:29 +0100 From: Geert Uytterhoeven To: Arnd Bergmann , Greg Kroah-Hartman Cc: Nguyen An Hoan , linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 2/2] eeprom: at25: Use spi_message_init_with_transfers() instead of open coding Date: Fri, 18 Jan 2019 15:05:25 +0100 Message-Id: <20190118140525.29189-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190118140525.29189-1-geert+renesas@glider.be> References: <20190118140525.29189-1-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reduce code duplication in at25_ee_read() by using the spi_message_init_with_transfers() helper. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- v2: - Add Acked-by. --- drivers/misc/eeprom/at25.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index 2d8e5388e574710d..18a093e14517ab45 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -103,16 +103,15 @@ static int at25_ee_read(void *priv, unsigned int offset, *cp++ = offset >> 0; } - spi_message_init(&m); memset(t, 0, sizeof(t)); t[0].tx_buf = command; t[0].len = at25->addrlen + 1; - spi_message_add_tail(&t[0], &m); t[1].rx_buf = buf; t[1].len = count; - spi_message_add_tail(&t[1], &m); + + spi_message_init_with_transfers(&m, t, ARRAY_SIZE(t)); mutex_lock(&at25->lock); -- 2.17.1