Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp859202ybe; Wed, 4 Sep 2019 08:47:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqw25Kx/qGyVEmZ/aYZQPemMMcgMCVMEzfe67hD+KR/Uk+zzryZFXU1GtbHPgyrJPi8tIVud X-Received: by 2002:a17:90a:ba85:: with SMTP id t5mr5446840pjr.26.1567612035654; Wed, 04 Sep 2019 08:47:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567612035; cv=none; d=google.com; s=arc-20160816; b=HtfswjwRgj/ncx8sMKqMH/N63NT15VCNDTHVHzxELYKVPrNkTCIhAeO9G28sh3HHdL uQwUeaYyRnZoTCChUSAhSFbK4KxAL+JpN0hRQ3lLz7thxVnaDEFq1jbFpRmmihzsdQyh 6zw/vvw5+0ewmE80QLt6q2yeXHy65oZzMf+14WCJWJK5HiXDykNBOTkmDqxjRdEv+rmI MDd+lBzMtTochStPlvuJSA46bmL2kCkrRMfqXXuGu0S/vXXC+xgr0pcDCjKl84st7r6/ 4R/zMexPZm4LzcGDNyPT+yf8X5WbIsqSmGvpn1gUxpYWgxQNdi8IDxeJBttu4lwBfHp6 VoRw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=DIOxKit7j3lzyRj4lae9XtM9Lrop7+IxcVbvjBtKvss=; b=cdFuK7J830vnNDg7ucqtqSpO1iZ9DYeWqbWLy0DbBG0VqYLRmVDS0M+qMngQ67WhtI zpjo7jvWIF/nNMsOvD8hfoUnL6myBoBi30pleDjtZfkFs+vD6em5gqEl34+ttrB3dkz+ 9e3Yr3kiZS9dHl64iKGjFKQUpudGRa0NfVtA4viXA4SqtJJ44MrByfAq5oAaS97uS+XE 2yiwtlARNDAdcYr0QL+OxMv3edSkWiWikZPdvKQEKopCKcPI24mD27tKXO3Xt2c7rEFq TR2Zem+RezN2Jl0+ZMz0psnX6NJvYtDiJzV50VGpGu84guQRtgB7R84M8lyWQEi5+5pc aekg== 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 j5si2637400pjf.60.2019.09.04.08.46.59; Wed, 04 Sep 2019 08:47:15 -0700 (PDT) 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 S1730615AbfIDPqF (ORCPT + 99 others); Wed, 4 Sep 2019 11:46:05 -0400 Received: from www1102.sakura.ne.jp ([219.94.129.142]:18121 "EHLO www1102.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729316AbfIDPqF (ORCPT ); Wed, 4 Sep 2019 11:46:05 -0400 Received: from fsav404.sakura.ne.jp (fsav404.sakura.ne.jp [133.242.250.103]) by www1102.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id x84Fk2VD072180; Thu, 5 Sep 2019 00:46:02 +0900 (JST) (envelope-from katsuhiro@katsuster.net) Received: from www1102.sakura.ne.jp (219.94.129.142) by fsav404.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav404.sakura.ne.jp); Thu, 05 Sep 2019 00:46:02 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav404.sakura.ne.jp) Received: from [192.168.1.2] (118.153.231.153.ap.dti.ne.jp [153.231.153.118]) (authenticated bits=0) by www1102.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id x84Fk2oG072177 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Thu, 5 Sep 2019 00:46:02 +0900 (JST) (envelope-from katsuhiro@katsuster.net) Subject: Re: [PATCH v3 2/4] ASoC: es8316: add clock control of MCLK To: Andy Shevchenko Cc: Mark Brown , David Yang , Daniel Drake , Hans de Goede , ALSA Development Mailing List , Linux Kernel Mailing List References: <20190903165322.20791-1-katsuhiro@katsuster.net> <20190903165322.20791-2-katsuhiro@katsuster.net> From: Katsuhiro Suzuki Message-ID: <23e51463-1d95-59dd-c449-d4245aadcab5@katsuster.net> Date: Thu, 5 Sep 2019 00:46:02 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andy, Thank you for reviewing. On 2019/09/04 23:37, Andy Shevchenko wrote: > On Tue, Sep 3, 2019 at 7:54 PM Katsuhiro Suzuki wrote: >> >> This patch introduce clock property for MCLK master freq control. >> Driver will set rate of MCLK master if set_sysclk is called and >> changing sysclk by board driver. >> >> Signed-off-by: Katsuhiro Suzuki > > >> + if (es8316->mclk) { > > You don't need this if clock has been requested as optional > (clk_get_optional() or so). > >> + ret = clk_set_rate(es8316->mclk, freq); >> + if (ret) >> + return ret; >> + } > >> + es8316->mclk = devm_clk_get(component->dev, "mclk"); >> + if (PTR_ERR(es8316->mclk) == -EPROBE_DEFER) >> + return -EPROBE_DEFER; >> + if (IS_ERR(es8316->mclk)) { >> + dev_err(component->dev, "clock is invalid, ignored\n"); >> + es8316->mclk = NULL; >> + } > > devm_clk_get_optional() > >> + if (es8316->mclk) { > > Ditto as above. > >> + ret = clk_prepare_enable(es8316->mclk); >> + if (ret) { >> + dev_err(component->dev, "unable to enable clock\n"); >> + return ret; >> + } >> + } > >> + if (es8316->mclk) > > Ditto. > >> + clk_disable_unprepare(es8316->mclk); >> +} > > Indeed, NULL check of MCLK is not needed. I'll make and send fixup patch. Best Regards, Katsuhiro Suzuki