Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1390617ima; Fri, 1 Feb 2019 23:17:26 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaf1kGaxhciE41sJbRJc8N0Dfis75sf9N4elWZhPi9i7ukUmvi9IYaZiHEnMBO/b/WVtNsX X-Received: by 2002:a63:955a:: with SMTP id t26mr5369518pgn.449.1549091846223; Fri, 01 Feb 2019 23:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549091846; cv=none; d=google.com; s=arc-20160816; b=T8figPv2gpMFDLNN+4KMFJbSRLad+9uU8bizY9OAxYx7yaoqcwfLJL9pALJIkDluJw 1e6pyZ/SIh2FujeXX9S10ExNz0VEeTSODRJR1avCMon84OHw78iFJTVcHMsn8EmUQKm3 8HDHpNZ00J5MBCy/kZZvtomnhXOvd2e0itFJqVQA76oyR4Dhk5m86tbZEqtPIsn/wwi8 mSez+YsoSz4DRNR7LgVVerDHZh8XinzA0DDjn257O5lhXeGlFJWEfp9XgA8oXv6ZS+kw 4h5FUo/YJsf5SLvTrNLy7R9y2wvxd1COSQrmdDoKUEJm+CG3DqcbpoXENMlwNvB3VkRG iaAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=0qZy+D8XWZP+QT83CA6yQMnXKdxbV6AvkhYCtdzOhnk=; b=EvT2wCnhNKeXuHEurHT0I91z/Ia4Y+iNbtBVGuHov2So4iqgt+PpiaSG1vYYjeNMYQ I3fNXIogF/GSgx1e8pgVy8OBJNkJ9soDXWNwj56atBlFrOQaPvmVLEib+NfeDoMpq8aC AyQFhpfKMMVHE7cT44D3Xn9p8Gs2glsFuzZOdORw9PDCekuI6jUiLHb1SwAsGBaAFaAy W3k0bXnhnDCTCuDn2DHfhHndRCtXsedPUCTygZmkxisshNRxdLVAk3s6N8Ydynn2a0/K 5xtUJIHhjWs8zUuByY6+bOTU9Pwg0JqcsU12bUX3rtBYkuw+J1/f5Qj7h+M7QJ99NXxn i7MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XV10zHJb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n125si8894941pga.179.2019.02.01.23.17.10; Fri, 01 Feb 2019 23:17:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XV10zHJb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbfBBHQm (ORCPT + 99 others); Sat, 2 Feb 2019 02:16:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:37256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfBBHQm (ORCPT ); Sat, 2 Feb 2019 02:16:42 -0500 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76D1420869; Sat, 2 Feb 2019 07:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549091800; bh=LbbWCY52MZJlTmK3M5ALRbknLFOVhDeo6yjUTIUVON4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=XV10zHJblF6h4vbJVPvIyVrzQD8uDn6PSM2LNL4FdmV0Y5YlRRmhdpLGRScahI4OF JWKEq830IrJPSm4Tn10+FlfsukSxQq0gQi4ooYffqCsE2GpCmUnnK977u1cRW2PWxO mj7xmS39AtqyhePekiP6LVOQ7xJsJHdqOuH6K/rw= Date: Sat, 2 Feb 2019 08:16:25 +0100 From: Boris Brezillon To: Cc: , , , , , , , , , , , , Subject: Re: [PATCH v3 11/13] spi: atmel-quadspi: add support for named peripheral clock Message-ID: <20190202081625.58a0be1d@bbrezillon> In-Reply-To: <20190202040653.1217-12-tudor.ambarus@microchip.com> References: <20190202040653.1217-1-tudor.ambarus@microchip.com> <20190202040653.1217-12-tudor.ambarus@microchip.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2 Feb 2019 04:07:41 +0000 wrote: > From: Tudor Ambarus > > Naming clocks is a good practice. Keep supporting unnamed > peripheral clock, to be backward compatible with old DTs. > While here, rename clk to pclk, to indicate that it is a > peripheral clock. > > Suggested-by: Boris Brezillon > Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon > --- > v3: new patch > > drivers/spi/atmel-quadspi.c | 33 ++++++++++++++++++--------------- > 1 file changed, 18 insertions(+), 15 deletions(-) > > diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c > index bfa5f5e92d96..c9548942535a 100644 > --- a/drivers/spi/atmel-quadspi.c > +++ b/drivers/spi/atmel-quadspi.c > @@ -136,7 +136,7 @@ > struct atmel_qspi { > void __iomem *regs; > void __iomem *mem; > - struct clk *clk; > + struct clk *pclk; > struct platform_device *pdev; > u32 pending; > u32 smm; > @@ -338,7 +338,7 @@ static int atmel_qspi_setup(struct spi_device *spi) > if (!spi->max_speed_hz) > return -EINVAL; > > - src_rate = clk_get_rate(aq->clk); > + src_rate = clk_get_rate(aq->pclk); > if (!src_rate) > return -EINVAL; > > @@ -429,15 +429,18 @@ static int atmel_qspi_probe(struct platform_device *pdev) > } > > /* Get the peripheral clock */ > - aq->clk = devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(aq->clk)) { > + aq->pclk = devm_clk_get(&pdev->dev, "pclk"); > + if (IS_ERR(aq->pclk)) > + aq->pclk = devm_clk_get(&pdev->dev, NULL); > + > + if (IS_ERR(aq->pclk)) { > dev_err(&pdev->dev, "missing peripheral clock\n"); > - err = PTR_ERR(aq->clk); > + err = PTR_ERR(aq->pclk); > goto exit; > } > > /* Enable the peripheral clock */ > - err = clk_prepare_enable(aq->clk); > + err = clk_prepare_enable(aq->pclk); > if (err) { > dev_err(&pdev->dev, "failed to enable the peripheral clock\n"); > goto exit; > @@ -448,25 +451,25 @@ static int atmel_qspi_probe(struct platform_device *pdev) > if (irq < 0) { > dev_err(&pdev->dev, "missing IRQ\n"); > err = irq; > - goto disable_clk; > + goto disable_pclk; > } > err = devm_request_irq(&pdev->dev, irq, atmel_qspi_interrupt, > 0, dev_name(&pdev->dev), aq); > if (err) > - goto disable_clk; > + goto disable_pclk; > > err = atmel_qspi_init(aq); > if (err) > - goto disable_clk; > + goto disable_pclk; > > err = spi_register_controller(ctrl); > if (err) > - goto disable_clk; > + goto disable_pclk; > > return 0; > > -disable_clk: > - clk_disable_unprepare(aq->clk); > +disable_pclk: > + clk_disable_unprepare(aq->pclk); > exit: > spi_controller_put(ctrl); > > @@ -480,7 +483,7 @@ static int atmel_qspi_remove(struct platform_device *pdev) > > spi_unregister_controller(ctrl); > writel_relaxed(QSPI_CR_QSPIDIS, aq->regs + QSPI_CR); > - clk_disable_unprepare(aq->clk); > + clk_disable_unprepare(aq->pclk); > return 0; > } > > @@ -488,7 +491,7 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev) > { > struct atmel_qspi *aq = dev_get_drvdata(dev); > > - clk_disable_unprepare(aq->clk); > + clk_disable_unprepare(aq->pclk); > > return 0; > } > @@ -497,7 +500,7 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev) > { > struct atmel_qspi *aq = dev_get_drvdata(dev); > > - clk_prepare_enable(aq->clk); > + clk_prepare_enable(aq->pclk); > > return atmel_qspi_init(aq); > }