From patchwork Fri Mar 29 13:00:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 10877009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00CC51805 for ; Fri, 29 Mar 2019 13:00:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E144D28F4B for ; Fri, 29 Mar 2019 13:00:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF8EF29074; Fri, 29 Mar 2019 13:00:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D64D28F4B for ; Fri, 29 Mar 2019 13:00:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729524AbfC2NAy (ORCPT ); Fri, 29 Mar 2019 09:00:54 -0400 Received: from mga09.intel.com ([134.134.136.24]:63046 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729477AbfC2NAx (ORCPT ); Fri, 29 Mar 2019 09:00:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2019 06:00:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,284,1549958400"; d="scan'208";a="331870451" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.56]) by fmsmga006.fm.intel.com with ESMTP; 29 Mar 2019 06:00:50 -0700 From: Jarkko Nikula To: linux-spi@vger.kernel.org Cc: Mark Brown , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Jarkko Nikula Subject: [PATCH 2/2] spi: pxa2xx: Unify remaing prints in pxa2xx_spi_transfer_one() Date: Fri, 29 Mar 2019 15:00:46 +0200 Message-Id: <20190329130046.27515-2-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190329130046.27515-1-jarkko.nikula@linux.intel.com> References: <20190329130046.27515-1-jarkko.nikula@linux.intel.com> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use SPI device pointer in the remaining two error and warning prints in pxa2xx_spi_transfer_one() instead of platform device of the controller It make prints in the function uniform and more useful especially the error print here as it can reveal the driver that has mapped the DMA itself and attempts to transfer more than the maximum supported DMA transfer length. Signed-off-by: Jarkko Nikula --- drivers/spi/spi-pxa2xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 6d935f351616..6160fe0ce7ab 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -943,7 +943,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller, /* reject already-mapped transfers; PIO won't always work */ if (message->is_dma_mapped || transfer->rx_dma || transfer->tx_dma) { - dev_err(&drv_data->pdev->dev, + dev_err(&spi->dev, "Mapped transfer length of %u is greater than %d\n", transfer->len, MAX_DMA_LEN); return -EINVAL; @@ -957,7 +957,7 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller, /* Setup the transfer state based on the type of transfer */ if (pxa2xx_spi_flush(drv_data) == 0) { - dev_err(&drv_data->pdev->dev, "Flush failed\n"); + dev_err(&spi->dev, "Flush failed\n"); return -EIO; } drv_data->n_bytes = chip->n_bytes;