Message ID | 20140721113019.GA13727@amd.pavel.ucw.cz |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show |
On Mon, 2014-07-21 at 13:30 +0200, ZY - pavel wrote: > Cleanups as suggested by wd on mailing list. > > Signed-off-by: Pavel Machek <pavel@denx.de> > > --- > > v2: calloc is actually needed, document it. > > --- a/drivers/mmc/socfpga_dw_mmc.c > +++ b/drivers/mmc/socfpga_dw_mmc.c > @@ -16,8 +16,6 @@ static const struct socfpga_clock_manager *clock_manager_base = > static const struct socfpga_system_manager *system_manager_base = > (void *)SOCFPGA_SYSMGR_ADDRESS; > > -static char *SOCFPGA_NAME = "SOCFPGA DWMMC"; > - > #define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK (1 << 8) > > static void socfpga_dwmci_clksel(struct dwmci_host *host) > @@ -47,14 +45,16 @@ static void socfpga_dwmci_clksel(struct dwmci_host *host) > > int socfpga_dwmmc_init(u32 regbase, int bus_width, int index) > { > - struct dwmci_host *host = NULL; > + struct dwmci_host *host; > + > + /* calloc for zero init */ > host = calloc(sizeof(struct dwmci_host), 1); > if (!host) { > printf("dwmci_host calloc fail!\n"); > return -1; > } > > - host->name = SOCFPGA_NAME; > + host->name = "SOCFPGA DWMMC"; > host->ioaddr = (void *)regbase; > host->buswidth = bus_width; > host->clksel = socfpga_dwmci_clksel; > > Acked-by: Chin Liang See <clsee@altera.com> Thanks Chin Liang
On Mon, Jul 21, 2014 at 01:30:19PM +0200, Pavel Machek wrote: > Cleanups as suggested by wd on mailing list. > > Signed-off-by: Pavel Machek <pavel@denx.de> > Acked-by: Chin Liang See <clsee@altera.com> Applied to u-boot/master, thanks!
--- a/drivers/mmc/socfpga_dw_mmc.c +++ b/drivers/mmc/socfpga_dw_mmc.c @@ -16,8 +16,6 @@ static const struct socfpga_clock_manager *clock_manager_base = static const struct socfpga_system_manager *system_manager_base = (void *)SOCFPGA_SYSMGR_ADDRESS; -static char *SOCFPGA_NAME = "SOCFPGA DWMMC"; - #define CLKMGR_PERPLLGRP_EN_SDMMCCLK_MASK (1 << 8) static void socfpga_dwmci_clksel(struct dwmci_host *host) @@ -47,14 +45,16 @@ static void socfpga_dwmci_clksel(struct dwmci_host *host) int socfpga_dwmmc_init(u32 regbase, int bus_width, int index) { - struct dwmci_host *host = NULL; + struct dwmci_host *host; + + /* calloc for zero init */ host = calloc(sizeof(struct dwmci_host), 1); if (!host) { printf("dwmci_host calloc fail!\n"); return -1; } - host->name = SOCFPGA_NAME; + host->name = "SOCFPGA DWMMC"; host->ioaddr = (void *)regbase; host->buswidth = bus_width; host->clksel = socfpga_dwmci_clksel;
Cleanups as suggested by wd on mailing list. Signed-off-by: Pavel Machek <pavel@denx.de> --- v2: calloc is actually needed, document it.