Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1641810pxj; Fri, 18 Jun 2021 11:29:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTH31ZgLUoPwK4WGvibWDIF5r18YpbCSLKYhVYxyV0Hi7fFKpfc5UjQ+qbdfubfkyYBAgT X-Received: by 2002:a5d:8190:: with SMTP id u16mr9167861ion.158.1624040986088; Fri, 18 Jun 2021 11:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624040986; cv=none; d=google.com; s=arc-20160816; b=fAwfXMI2ypWt3RV4+TCyyfb7OR7quiwQfIXab8h3wroh3nfiD/iRwu1Wpybze8ETQe u5B5SULaCLkWytiK2IgEx/tS8zGRtC/OZJMnZ4a742Itt+cnLa+hIQH73Lb3pr+0o3rB EvQwTNpNtWevEvRxpFecm3AgBwdqyAkMF02xfPzIfCe+h+liD0GCE9kOT1rAxwwYYRsD Uh5X8/qoFG9JLKaJtTBe+e6qnuKO0XYYJiA3B/Ekmvf+njdzHIKNRczAei4/PR3L7ebq mb5VhJkL/OHUHNxvDCikJy2YQlj/xMldPN14GGLxaozKHB5Qr7T6cZhpDeUALZQjOPW7 lkpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=j7+uP79JThVaX8f53c7eMngvAvys/A7Np1BX1mntKjE=; b=B7JoiR/3GWiyAEfZfue98syD3Bttm0LgZkFJMJr9GnZH2AjVA1fJbHDiCnf5gvwbew cEOnmzkcEy+Lz1zsecdQntqgMPwJ6dhau88wqObxHM7grsKhTORQFKIgQv+zKD5VIQOx nhHta9izYOX+SkB0WaX8zZOPWOMy6b5lmgoiiLkilMc0I5dW3bhW61K9JF9vi1a3/Jd/ mTzs8QLzIRfWHXsSvq8XavmFn2FVr+qiseWiAhCJ6IslpEqteluSrr+2BZ37tKVYxYu9 3te2zzZyAZ2axLmCyAqq0gkO9mgZjQFlS8h4UPnFVekmZzSavpz5v5nNpJlv6k4iJqYe gXEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mRLykS7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si3326792ilu.105.2021.06.18.11.29.33; Fri, 18 Jun 2021 11:29:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mRLykS7i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233577AbhFRPfm (ORCPT + 99 others); Fri, 18 Jun 2021 11:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234467AbhFRPfW (ORCPT ); Fri, 18 Jun 2021 11:35:22 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E373C0617A8 for ; Fri, 18 Jun 2021 08:33:12 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id r7so9147524edv.12 for ; Fri, 18 Jun 2021 08:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j7+uP79JThVaX8f53c7eMngvAvys/A7Np1BX1mntKjE=; b=mRLykS7ioyfUInLCKyugxfYIbQA1nW7S1oNhEUyFkiSp7eggq3BCN3mamatVEHbwvH sp4rxG+AX6EV/kIEvdI7+nPD6iVJU3/mhL3KvRMXMyTj/erLDUE/3q1QDNwhRjzLpgLb yUfFZaEEO5KIIUtp7JuhS5Rgv40SLegrVmV4CoHEBheMMkVvmR2k+7bkwMho5/kuXodG IyiSjFjRXWQeoxJ6PVHHAY6Y9bnDiIiHWaSZ+gdyBu/O1GSMfoansFSBGUxOqtpntgj4 xuYw20gmMzVdOFH3POAEcLJY0G9mNDR7wK49JcXX4YqhOGy9HnmezEoQTKegD6O4kHuD dLMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j7+uP79JThVaX8f53c7eMngvAvys/A7Np1BX1mntKjE=; b=qtZMVmX5AYVvlSanC8zjcrIUgR0Y+kUZYZD5Flu+FISAPpICViUsCKDGkybf1m98tJ O/ORsYsQi/XWvPMHzckBgGXM8tecctRW3jup4ZH+32S+mrvzj2KEVVykMJzvHzuopT8D QpaNnH/TwDhLc8n/Byhss/UafdjdYB7ycRWmZQxLnDtF5lDv3vLxxZzoewYB+81S41IG tXi+pqtTW7NFlKM5f2UqP1/7q1EN6/Lx4jch0iRe6BXzHndUt12vNLMyXmw/domu7HU6 O32Dq1Zn5IUrFT2mXH2zENr48LG19QIDQIjqyXctvzXohk7E/oUAX4cl8pW+oTPwPfb0 lyoQ== X-Gm-Message-State: AOAM5325c5jWmCrdp2O0pVWBHPYootQNghzfonyc+LjbBa+6wLMEHZmZ U/G61sQ9AbrcKfewuZvs3xALwz8utTeSlBEurDE= X-Received: by 2002:aa7:c40a:: with SMTP id j10mr5732813edq.59.1624030390723; Fri, 18 Jun 2021 08:33:10 -0700 (PDT) MIME-Version: 1.0 References: <20210617194154.2397-1-linux.amoon@gmail.com> <20210617194154.2397-2-linux.amoon@gmail.com> In-Reply-To: From: Anand Moon Date: Fri, 18 Jun 2021 21:02:59 +0530 Message-ID: Subject: Re: [RFCv1 1/8] phy: amlogic: meson8b-usb2: Use clock bulk to get clocks for phy To: Martin Blumenstingl Cc: Kishon Vijay Abraham I , Vinod Koul , Neil Armstrong , Kevin Hilman , Jerome Brunet , Philipp Zabel , linux-phy@lists.infradead.org, linux-arm-kernel , linux-amlogic@lists.infradead.org, Linux Kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, On Fri, 18 Jun 2021 at 04:03, Martin Blumenstingl wrote: > > Hi Anand, > > On Thu, Jun 17, 2021 at 9:42 PM Anand Moon wrote: > [...] > > + int num_clks; > > + struct clk_bulk_data *clks; > personally I'd get rid of the num_clks as this value is static > instead I would add a #define with the number of clocks and then... > > > struct reset_control *reset; > ... use something like: > struct clk_bulk_data clks[MESON8B_USB2_PHY_NUM_CLKS]; > > [...] > > + dev_err(&phy->dev, "Failed to enable USB clock\n"); > clock -> clocks > > [...] > > + priv->num_clks = ARRAY_SIZE(meson_phy_clks); > > + priv->clks = devm_kcalloc(&pdev->dev, priv->num_clks, > > + sizeof(*priv->clks), GFP_KERNEL); > > + if (!priv->clks) > > + return -ENOMEM; > by using a fixed-size array as suggested above you don't need to > dynamically allocate memory anymore > > Thanks for this tip.It works for me. > Best regards, > Martin Thanks -Anand