From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Mon, 28 Nov 2016 08:36:42 +0100 Subject: [U-Boot] [PATCH v2 2/4] serial: zynq: Remove unused index from get uart clock function In-Reply-To: <1480082395-14750-3-git-send-email-stefan.herbrechtsmeier@weidmueller.de> References: <1480082395-14750-1-git-send-email-stefan.herbrechtsmeier@weidmueller.de> <1480082395-14750-3-git-send-email-stefan.herbrechtsmeier@weidmueller.de> Message-ID: <2e2d9103-084d-ddba-1b6b-5e13eb87e543@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 25.11.2016 14:59, Stefan Herbrechtsmeier wrote: > The index of the zynq serial driver is always zero and could be removed. > > Signed-off-by: Stefan Herbrechtsmeier > > --- > > Changes in v2: > - Remove unused index from get uart clock function > > arch/arm/mach-zynq/clk.c | 3 +-- > arch/arm/mach-zynq/include/mach/clk.h | 2 +- > drivers/serial/serial_zynq.c | 2 +- > 3 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/mach-zynq/clk.c b/arch/arm/mach-zynq/clk.c > index 40383c1..e256b58 100644 > --- a/arch/arm/mach-zynq/clk.c > +++ b/arch/arm/mach-zynq/clk.c > @@ -551,13 +551,12 @@ void zynq_clk_early_init(void) > > /** > * get_uart_clk() - Get UART input frequency > - * @dev_index: UART ID > * Returns UART input clock frequency in Hz. > * > * Compared to zynq_clk_get_rate() this function is designed to work before > * relocation and can be called when the serial UART is set up. > */ > -unsigned long get_uart_clk(int dev_index) > +unsigned long get_uart_clk(void) > { > u32 reg = readl(&slcr_base->uart_clk_ctrl); > u32 div = (reg & CLK_CTRL_DIV0_MASK) >> CLK_CTRL_DIV0_SHIFT; > diff --git a/arch/arm/mach-zynq/include/mach/clk.h b/arch/arm/mach-zynq/include/mach/clk.h > index 250c5bc..ba2210d 100644 > --- a/arch/arm/mach-zynq/include/mach/clk.h > +++ b/arch/arm/mach-zynq/include/mach/clk.h > @@ -24,6 +24,6 @@ void zynq_clk_early_init(void); > int zynq_clk_set_rate(enum zynq_clk clk, unsigned long rate); > unsigned long zynq_clk_get_rate(enum zynq_clk clk); > const char *zynq_clk_get_name(enum zynq_clk clk); > -unsigned long get_uart_clk(int dev_id); > +unsigned long get_uart_clk(void); > > #endif > diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c > index 4f6e7e4..461ba86 100644 > --- a/drivers/serial/serial_zynq.c > +++ b/drivers/serial/serial_zynq.c > @@ -134,7 +134,7 @@ int zynq_serial_setbrg(struct udevice *dev, int baudrate) > return ret; > } > #else > - clock = get_uart_clk(0); > + clock = get_uart_clk(); > #endif > _uart_zynq_serial_setbrg(priv->regs, clock, baudrate); > > Not a problem with this patch but real solution for this is code above. When we move zynq clk driver to DM then we should remove these functions entirely. Anyway Acked-by: Michal Simek Thanks, Michal