Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3518237pxy; Tue, 4 May 2021 04:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd/nvVdoy1FyjSsKinV87pJbWrGz/EwStUUr3CpwQ9F4JrxG/fQrxFwuOGXVcKVznnT+ys X-Received: by 2002:a65:420d:: with SMTP id c13mr22877595pgq.370.1620126896828; Tue, 04 May 2021 04:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620126896; cv=none; d=google.com; s=arc-20160816; b=QMozwPi5XmSm3hfhW6tMcZkjNSEGh4sr24dcZvaBb4HphrdJUKQzYwTaxsyipNzgbf Zy5or+sRyVOiTa2o4UsKiudMTzlWGx8eoHueX6s7fqlalUcewjtsVrarm2NXhcTb/3TT ppmLY59L8vKYVyWykBRiOj2lkrkzxPod5u5RI417ap0G79Gcr+YKZCdzEIFi4Txv0H+L V3rsyrpKzTkJy248nPL7Vv7Ezejl+cUckEkZQTCbQkQqxT6BNpxRpUkLbcFhsHrXSBAm Gr/CLy1YbjJwy1DooSlssoNlhBz4dQPA22ixJDMfHwKNZm+6nwX+EC8BiERsvzwlxstO lYSg== 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=pB5B5vGNh7JfHcktCPrIN1oKnZroXbXhhazB4fhfugs=; b=HaGMav939yFT7AcoCSEWAuhD9pdQu1Wvur2aznJBdRZJrI4/o4Qb2i2pBQbeTDZsIU 9qdbBbUoJnSLhRYqNaG3b2vbpNoSUZblcCR9cfgCfeGZceZ5wo+HdJA6yehL4hwUO0an x/4aV5VnqHBEgw9o5MAj8Uey4aX4Pd0MpaI8TLn4ZSn4LGk4IXAjTradt3r7BrL1dciQ ZPvkLR/BOLrUdW1fzpda2QEra5rdrvyu7yOvJc94aoj76TCbNItclymkPJ7a2DExQMwC glB6tWvudqJ2hqx4gtXMcsH5iIFfBko6TSS5fYXoGBC055SRo0AQQBBWYOYIihbK8IXO agNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oNSPNdRD; 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 l8si2837976pgq.503.2021.05.04.04.14.42; Tue, 04 May 2021 04:14:56 -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=oNSPNdRD; 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 S230046AbhEDLOz (ORCPT + 99 others); Tue, 4 May 2021 07:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229953AbhEDLOy (ORCPT ); Tue, 4 May 2021 07:14:54 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 382F9C061574; Tue, 4 May 2021 04:13:51 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id n138so12733905lfa.3; Tue, 04 May 2021 04:13:51 -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=pB5B5vGNh7JfHcktCPrIN1oKnZroXbXhhazB4fhfugs=; b=oNSPNdRDAz8qH2TjdHNrrOZBUXHAk1AW+N8S5H5ogqryWPMQi9KOocAneEwqXpTVXs ylKiI0NgwCfGfIoXSWwQdH4/AOTIOkG100mic0aTxvilePSoeJN+/tqw33mqhTyqhLWr pUexxleUqI4xWy9RMKG0S2uYGTthjNBPanajP/2M4fW96bUFRAtz+Rjr68oh8jc0+pt5 8GmTHFMcqtxZ43bdxsjmrIZYmXc4i2gyZrND40eG3FqwmI/m5l1lX+OYHNv8RK7HTqB+ C2QIafQceFabyo4Qh8nP1M+aTYm9WIZiL3QaA6EL6rkPIGen1YyNWFWhTXZTppFMas3/ l99A== 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=pB5B5vGNh7JfHcktCPrIN1oKnZroXbXhhazB4fhfugs=; b=cKQYisWozTlupnipSQHDh761ubUMlw81F/v25IdZhs5d9imzmXVy37FuiJGtLpxahX Dp/Lwp5Wf67NxpYhkmlJzKs56YXkbF2P+C35HcmvlsO47xPEidKZwBCkUSsxZwUyrYM6 SxFuVhGLKKeM7Rltj7kWieqwjzyLLY1Kxp/KIZwFA9l7AHjiLKHbKymZA0VALBspYYEk rm0wLBntzVqP4CTXn16mcz6Ys8eYrafLXmzItw/ZdZkyxRfiyEX2V6hzetAFuIYua93T je81Px1NPqgy4NsD3qFcbupQkTKj0R7k40JasaQvIiILJ+qmMoDzcYUDedvaaawBHw3b KzWw== X-Gm-Message-State: AOAM530yLQxObyndB/uhpOpa2odtuH5lbp1OcqTa0TrzlcJ0O/aky9JF nQIFklRJZcgUPHou4Z2SII5sbLl5InYTVU0a1pY= X-Received: by 2002:ac2:4308:: with SMTP id l8mr15510685lfh.223.1620126829233; Tue, 04 May 2021 04:13:49 -0700 (PDT) MIME-Version: 1.0 References: <20210430052746.10815-1-peng.fan@oss.nxp.com> <20210430052746.10815-5-peng.fan@oss.nxp.com> In-Reply-To: <20210430052746.10815-5-peng.fan@oss.nxp.com> From: Fabio Estevam Date: Tue, 4 May 2021 08:13:37 -0300 Message-ID: Subject: Re: [PATCH V2 4/4] soc: imx: Add blk-ctl driver for i.MX8MM To: "Peng Fan (OSS)" Cc: Rob Herring , Shawn Guo , Sascha Hauer , Sascha Hauer , NXP Linux Team , Philipp Zabel , Lucas Stach , Krzysztof Kozlowski , =?UTF-8?Q?Guido_G=C3=BCnther?= , Marek Vasut , Andrey Smirnov , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-kernel , Ping Bai , Schrempf Frieder , Adam Ford , Abel Vesa , Peng Fan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peng, On Fri, Apr 30, 2021 at 1:56 AM Peng Fan (OSS) wrote: > +static int imx8mm_blk_ctl_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + const struct imx_blk_ctl_dev_data *dev_data = of_device_get_match_data(dev); > + struct regmap *regmap; > + struct resource *res; > + struct imx_blk_ctl *ctl; > + void __iomem *base; > + > + ctl = devm_kzalloc(dev, sizeof(*ctl), GFP_KERNEL); > + if (!ctl) > + return -ENOMEM; > + > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + base = devm_ioremap_resource(dev, res); > + if (IS_ERR(base)) > + return PTR_ERR(base); > + > + regmap = devm_regmap_init_mmio(dev, base, &dev_data->config); > + if (IS_ERR(regmap)) > + return PTR_ERR(regmap); > + > + ctl->regmap = regmap; > + ctl->dev = dev; > + atomic_set(&ctl->power_count, 0); > + > + ctl->num_clks = devm_clk_bulk_get_all(dev, &ctl->clks); > + if (ctl->num_clks < 0) > + return ctl->num_clks; > + > + dev_set_drvdata(dev, ctl); > + ctl->dev_data = of_device_get_match_data(dev); No need to call of_device_get_match_data() twice. You could do: ctl->dev_data = dev_data;