From: Chunfeng Yun Date: Thu, 13 Aug 2020 16:05:09 +0800 Subject: Aw: Re: [PATCH v2 4/5] ahci: mediatek: add ahci driver In-Reply-To: References: <20200810175239.8564-1-linux@fw-web.de> <20200810175239.8564-5-linux@fw-web.de> <1597297942.24417.6.camel@mhfsdcap03> Message-ID: <1597305909.24774.10.camel@mhfsdcap03> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2020-08-13 at 09:33 +0200, Frank Wunderlich wrote: > Hi, > > thanks for first review > > > Gesendet: Donnerstag, 13. August 2020 um 07:52 Uhr > > Von: "Chunfeng Yun" > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > > alphabetic sort? > > at least common.h neds to be first ;) but then it looks like this: > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > > > +struct mtk_ahci_priv { > > > + void *base; > > > + > > > + struct regmap *mode; > > > + struct reset_ctl axi_rst; > > > + struct reset_ctl sw_rst; > > > + struct reset_ctl reg_rst; > > How about using reset_ctl_bulk? > > this will drop mtk_ahci_platform_resets and add this in probe, right? Both are ok for me > > struct reset_ctl_bulk rst_bulk; > > ret = reset_get_bulk(dev, &rst_bulk); > if (!ret) { > reset_assert_bulk(&rst_bulk); > reset_deassert_bulk(&rst_bulk); > } else > dev_err(dev, "Failed to get reset: %d\n", ret); add {} for dev_err > > > > > + priv->base = map_physmem(devfdt_get_addr(dev), sizeof(void *), > > > + MAP_NOCACHE); > > use devfdt_remap_addr_index/name instead? > > have to look how these work/other drivers use this... > > > > + hpriv = malloc(sizeof(struct ahci_uc_priv)); > > > + if (!hpriv) > > > + return -ENOMEM; > > How about put an ahci_uc_priv struct instance in mtk_ahci_priv struct, > > then no need malloc it here? > > ok, i test with this :) > can memset also dropped? Yes, device core will set it to zero in alloc_priv()