From patchwork Thu Oct 22 13:44:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 7465081 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7EDDF9F30B for ; Thu, 22 Oct 2015 13:45:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F8F12095D for ; Thu, 22 Oct 2015 13:45:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24D2A2095F for ; Thu, 22 Oct 2015 13:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757577AbbJVNpG (ORCPT ); Thu, 22 Oct 2015 09:45:06 -0400 Received: from mga14.intel.com ([192.55.52.115]:32353 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757550AbbJVNpF (ORCPT ); Thu, 22 Oct 2015 09:45:05 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 22 Oct 2015 06:44:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,182,1444719600"; d="scan'208";a="586007218" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.66]) by FMSMGA003.fm.intel.com with ESMTP; 22 Oct 2015 06:44:51 -0700 From: Jarkko Nikula To: linux-spi@vger.kernel.org Cc: Mark Brown , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Andy Shevchenko , Jarkko Nikula Subject: [PATCH 2/7] spi: pxa2xx: derive struct chip_data from struct drv_data Date: Thu, 22 Oct 2015 16:44:40 +0300 Message-Id: <1445521485-2029-2-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445521485-2029-1-git-send-email-jarkko.nikula@linux.intel.com> References: <1445521485-2029-1-git-send-email-jarkko.nikula@linux.intel.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andy Shevchenko Since we call pxa2xx_ssp_get_clk_div() from pump_transfers() we may derive pointer to struct chip_data from struct drv_data like it's done in the rest of the functions. This will make it less errorprone. Signed-off-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Acked-by: Robert Jarzmik --- drivers/spi/spi-pxa2xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 573a28b13a09..e02ea46168eb 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -818,8 +818,9 @@ static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate) } static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data, - struct chip_data *chip, int rate) + int rate) { + struct chip_data *chip = drv_data->cur_chip; unsigned int clk_div; switch (drv_data->ssp_type) { @@ -925,7 +926,7 @@ static void pump_transfers(unsigned long data) bits = transfer->bits_per_word; speed = transfer->speed_hz; - clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, speed); + clk_div = pxa2xx_ssp_get_clk_div(drv_data, speed); if (bits <= 8) { drv_data->n_bytes = 1;