* [U-Boot] [PATCH v2] spi: zynq_qspi: Minor cleanups
@ 2015-10-25 14:19 Jagan Teki
2015-10-25 18:51 ` Tom Rini
0 siblings, 1 reply; 3+ messages in thread
From: Jagan Teki @ 2015-10-25 14:19 UTC (permalink / raw)
To: u-boot
- Use __func__ on debug
- Removed unnecessary comment
- Fix function name in debug as zynq_qspi_xfer instead of spi_xfer
Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
Changes for v2:
- Fix commit message - Use meaningful commit header,
add proper details for all fixes.
- Fix debug print in zynq_qspi_xfer
drivers/spi/zynq_qspi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
index 8aa61d7..6963c13 100644
--- a/drivers/spi/zynq_qspi.c
+++ b/drivers/spi/zynq_qspi.c
@@ -430,7 +430,6 @@ static int zynq_qspi_start_transfer(struct zynq_qspi_priv *priv)
zynq_qspi_fill_tx_fifo(priv, priv->fifo_depth);
writel(ZYNQ_QSPI_IXR_ALL_MASK, ®s->ier);
- /* Start the transfer by enabling manual start bit */
/* wait for completion */
do {
@@ -516,7 +515,7 @@ static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen,
priv->rx_buf = din;
priv->len = bitlen / 8;
- debug("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n",
+ debug("zynq_qspi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n",
bus->seq, slave_plat->cs, bitlen, priv->len, flags);
/*
@@ -569,8 +568,7 @@ static int zynq_qspi_set_speed(struct udevice *bus, uint speed)
writel(confr, ®s->cr);
priv->freq = speed;
- debug("zynq_spi_set_speed: regs=%p, speed=%d\n",
- priv->regs, priv->freq);
+ debug("%s: regs=%p, speed=%d\n", __func__, priv->regs, priv->freq);
return 0;
}
@@ -593,7 +591,7 @@ static int zynq_qspi_set_mode(struct udevice *bus, uint mode)
writel(confr, ®s->cr);
priv->mode = mode;
- debug("zynq_spi_set_mode: regs=%p, mode=%d\n", priv->regs, priv->mode);
+ debug("%s: regs=%p, mode=%d\n", __func__, priv->regs, priv->mode);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] spi: zynq_qspi: Minor cleanups
2015-10-25 14:19 [U-Boot] [PATCH v2] spi: zynq_qspi: Minor cleanups Jagan Teki
@ 2015-10-25 18:51 ` Tom Rini
2015-10-26 4:56 ` Jagan Teki
0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2015-10-25 18:51 UTC (permalink / raw)
To: u-boot
On Sun, Oct 25, 2015 at 07:49:57PM +0530, Jagan Teki wrote:
> - Use __func__ on debug
> - Removed unnecessary comment
> - Fix function name in debug as zynq_qspi_xfer instead of spi_xfer
>
> Cc: Tom Rini <trini@konsulko.com>
> Signed-off-by: Jagan Teki <jteki@openedev.com>
> ---
> Changes for v2:
> - Fix commit message - Use meaningful commit header,
> add proper details for all fixes.
> - Fix debug print in zynq_qspi_xfer
>
> drivers/spi/zynq_qspi.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
> index 8aa61d7..6963c13 100644
> --- a/drivers/spi/zynq_qspi.c
> +++ b/drivers/spi/zynq_qspi.c
> @@ -430,7 +430,6 @@ static int zynq_qspi_start_transfer(struct zynq_qspi_priv *priv)
> zynq_qspi_fill_tx_fifo(priv, priv->fifo_depth);
>
> writel(ZYNQ_QSPI_IXR_ALL_MASK, ®s->ier);
> - /* Start the transfer by enabling manual start bit */
>
> /* wait for completion */
> do {
> @@ -516,7 +515,7 @@ static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen,
> priv->rx_buf = din;
> priv->len = bitlen / 8;
>
> - debug("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n",
> + debug("zynq_qspi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n",
> bus->seq, slave_plat->cs, bitlen, priv->len, flags);
>
> /*
I'm not poking the code regularly myself so, ok, sure. But why not
__func__? I don't get it.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151025/5801b397/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] spi: zynq_qspi: Minor cleanups
2015-10-25 18:51 ` Tom Rini
@ 2015-10-26 4:56 ` Jagan Teki
0 siblings, 0 replies; 3+ messages in thread
From: Jagan Teki @ 2015-10-26 4:56 UTC (permalink / raw)
To: u-boot
On 26 October 2015 at 00:21, Tom Rini <trini@konsulko.com> wrote:
> On Sun, Oct 25, 2015 at 07:49:57PM +0530, Jagan Teki wrote:
>> - Use __func__ on debug
>> - Removed unnecessary comment
>> - Fix function name in debug as zynq_qspi_xfer instead of spi_xfer
>>
>> Cc: Tom Rini <trini@konsulko.com>
>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>> ---
>> Changes for v2:
>> - Fix commit message - Use meaningful commit header,
>> add proper details for all fixes.
>> - Fix debug print in zynq_qspi_xfer
>>
>> drivers/spi/zynq_qspi.c | 8 +++-----
>> 1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/spi/zynq_qspi.c b/drivers/spi/zynq_qspi.c
>> index 8aa61d7..6963c13 100644
>> --- a/drivers/spi/zynq_qspi.c
>> +++ b/drivers/spi/zynq_qspi.c
>> @@ -430,7 +430,6 @@ static int zynq_qspi_start_transfer(struct zynq_qspi_priv *priv)
>> zynq_qspi_fill_tx_fifo(priv, priv->fifo_depth);
>>
>> writel(ZYNQ_QSPI_IXR_ALL_MASK, ®s->ier);
>> - /* Start the transfer by enabling manual start bit */
>>
>> /* wait for completion */
>> do {
>> @@ -516,7 +515,7 @@ static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen,
>> priv->rx_buf = din;
>> priv->len = bitlen / 8;
>>
>> - debug("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n",
>> + debug("zynq_qspi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n",
>> bus->seq, slave_plat->cs, bitlen, priv->len, flags);
>>
>> /*
>
> I'm not poking the code regularly myself so, ok, sure. But why not
> __func__? I don't get it.
I prefer __func__ for large function name and function being called
less times and in case zynq_qspi_xfer I would go directly use function
name as it being called for each transaction and function name is also
small. It's not the case with remaining once.
--
Jagan | openedev.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-26 4:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-25 14:19 [U-Boot] [PATCH v2] spi: zynq_qspi: Minor cleanups Jagan Teki
2015-10-25 18:51 ` Tom Rini
2015-10-26 4:56 ` Jagan Teki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.