Received: by 10.223.176.5 with SMTP id f5csp1029134wra; Fri, 2 Feb 2018 09:59:33 -0800 (PST) X-Google-Smtp-Source: AH8x226zz2Fx/tGc/YTNeYv7E5WKLi8Wu3mr97w0VYpkU5FF4zj6tAFCTt4wXpalDyS4EOnDQwT8 X-Received: by 2002:a17:902:1c3:: with SMTP id b61-v6mr35605909plb.190.1517594373821; Fri, 02 Feb 2018 09:59:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517594373; cv=none; d=google.com; s=arc-20160816; b=EE0JrIUGdfvWUqZAKE9PX3VtPQq54UicSpwCKZEDx70n0eJlhQAfWwIVVYH33JkFnn Bvrm9Dlt/+uLtxzmP+cAxnpIDRKsSQgq2mG2/I5I04+1zOrkMsYSOEZr1iZLuDNVKMRV bB3uNz51H3ubYDEafhizh7XtJMTMSDlZRytCQg8tPXRGbJFGnErYHOpBl7WtGJMrFXvR oOGB099FXBdGPZMUKEaAVE6J1nHUvMoCVFSwMAkMeHGUsU3ncHjGCPDfVveGJUK/Sj6T 5A/35lBTRKcRorMwbdH2klN3HF4hDQuuYl+fcXcof/jlOEi9aDb7J4oPMTD46HwVvjK3 o5eQ== 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:dkim-signature :arc-authentication-results; bh=HWSeH+uLv910yWcBKo1w2Xq2Oy+XAad+Alg95FXaSAU=; b=a95FkdKsoHBFzToe+uw5KHS8CLY6eOKKe0/Z1Ovgc8eHFpE0EVhLWzGc+kVpgyiY4s OlnAVLJKRqBv1FBL6nbmWkoalZUFVw5hx7hKIayWFj2e9haFK56VUFOdC1C8ywsjsEM4 ywphJyqLk5vqfr+/1ziNhqF5KdUiQvQ2Va9lCqPzkEkl1S/wqTeY/KCvsNFi9oc28vwk h/KUMNsgeMUfN3tLp9ft5+neHxpk/RVPSc61jG8pGuCbvF32azIz4sYte1ugkGTOfOkS IKf/pesNVbLb6zJtJNI00CgMkzNxLIiFqLRaCKTrAHn65rosnu4syxnVg5vW09KjnUYZ o2bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=c/KAzTLC; 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 y8-v6si2261292plk.535.2018.02.02.09.59.18; Fri, 02 Feb 2018 09:59:33 -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=fail header.i=@lechnology.com header.s=default header.b=c/KAzTLC; 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 S1753375AbeBBR5K (ORCPT + 99 others); Fri, 2 Feb 2018 12:57:10 -0500 Received: from vern.gendns.com ([206.190.152.46]:48197 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752673AbeBBR4H (ORCPT ); Fri, 2 Feb 2018 12:56:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HWSeH+uLv910yWcBKo1w2Xq2Oy+XAad+Alg95FXaSAU=; b=c/KAzTLC4CRXXMW1XS/7Qv+ObO T9Z0Chu6v5atGxAMnhHPFsPR91XULzUUsTDZKW/Ps8MjriHS7VrIio5E4ZWCQxZ8psV/FbBlvCSFD PInWApiqP9wGxtR/8+hbqP0F6KKqmXhVEIH3SaA7OiWfJJHKpnrTyhkceG/9tfjPkf8w22KqxFiyK IT49BQkFZZQqVdFJQiPv1/gSS9COCbTBzv+gaTWR5gISq8vNihkbEgMQBS0/koCoaTqcYmHcsKUJH pk/XLHo5bccP37Vfpg1azSM+EacV6gi6HhjIhTt++R5tZtDMRO581dixO/ZObOgc3Fwn0pYID6Pam bblIPRuA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:56832 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1ehfYQ-001ldP-F7; Fri, 02 Feb 2018 12:55:14 -0500 Subject: Re: [PATCH v6 18/41] clk: davinci: New driver for TI DA8XX CFGCHIP clocks To: Sekhar Nori , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Kevin Hilman , Bartosz Golaszewski , Adam Ford , linux-kernel@vger.kernel.org References: <1516468460-4908-1-git-send-email-david@lechnology.com> <1516468460-4908-19-git-send-email-david@lechnology.com> From: David Lechner Message-ID: Date: Fri, 2 Feb 2018 11:56:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.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 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/2018 07:19 AM, Sekhar Nori wrote: > On Saturday 20 January 2018 10:43 PM, David Lechner wrote: >> +static const struct clk_ops da8xx_cfgchip_div4p5_clk_ops = { >> + .enable = da8xx_cfgchip_gate_clk_enable, >> + .disable = da8xx_cfgchip_gate_clk_disable, >> + .is_enabled = da8xx_cfgchip_gate_clk_is_enabled, > > I assume the reason for not using clk-gate.c is lack of regmap support > there? Correct. I couldn't find a way to get a lock from the regmap that could be passed to clk_register_gate() to prevent non-clock drivers from trying to use the regmap at the same the the clocks are. > >> + .recalc_rate = da8xx_cfgchip_div4p5_recalc_rate, >> +}; >> + >> +static struct clk * __init >> +da8xx_cfgchip_gate_clk_register(const struct da8xx_cfgchip_gate_clk_info *info, >> + const char *parent_name, >> + struct regmap *regmap) >> +{ >> + struct da8xx_cfgchip_gate_clk *gate; >> + struct clk_init_data init; >> + >> + gate = kzalloc(sizeof(*gate), GFP_KERNEL); >> + if (!gate) >> + return ERR_PTR(-ENOMEM); >> + >> + init.name = info->name; >> + if (info->flags & DA8XX_GATE_CLOCK_IS_DIV4P5) >> + init.ops = &da8xx_cfgchip_div4p5_clk_ops; >> + else >> + init.ops = &da8xx_cfgchip_gate_clk_ops; > > This will be easier to read using ternary operator, I think. But you > will probably have line breaks. The names are so long that the ternary operator doesn't make it better IMHO. init.ops = (info->flags & DA8XX_GATE_CLOCK_IS_DIV4P5) ? &da8xx_cfgchip_div4p5_clk_ops : &da8xx_cfgchip_gate_clk_ops;