diff mbox series

[4/4] mtd: spi-nor: drop superfluous debug prints

Message ID 20231215082138.16063-5-tudor.ambarus@linaro.org
State Accepted
Delegated to: Ambarus Tudor
Headers show
Series mtd: spi-nor: mark the flash name as obsolete | expand

Commit Message

Tudor Ambarus Dec. 15, 2023, 8:21 a.m. UTC
The mtd data hall be obtained with the mtd ioctls or with new debugs
entries if one cares. Drop the debug prints.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/mtd/spi-nor/core.c | 16 ----------------
 1 file changed, 16 deletions(-)

Comments

Tudor Ambarus Dec. 15, 2023, 8:24 a.m. UTC | #1
I missed to drop some unused variables. Will drop them if everything
else is fine.

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index a708c3448809..92c992eb73d5 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3492,9 +3492,7 @@ int spi_nor_scan(struct spi_nor *nor, const char
*name,
 {
        const struct flash_info *info;
        struct device *dev = nor->dev;
-       struct mtd_info *mtd = &nor->mtd;
        int ret;
-       int i;

        ret = spi_nor_check(nor);
        if (ret)
Michael Walle Dec. 18, 2023, 12:14 p.m. UTC | #2
Am 2023-12-15 09:21, schrieb Tudor Ambarus:
> The mtd data hall be obtained with the mtd ioctls or with new debugs

shall, debugfs

> entries if one cares. Drop the debug prints.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>

With the above and the unused variables fixed:

Reviewed-by: Michael Walle <michael@walle.cc>

Miquel raised a valid point that if the rootfs is on this very
flash and if there is an error, you cannot use debugfs or the
ioctls. But I doubt that the info about the erase regions will
help much in that case.

-michael
Pratyush Yadav Jan. 29, 2024, 1:26 p.m. UTC | #3
On Fri, Dec 15 2023, Tudor Ambarus wrote:

> I missed to drop some unused variables. Will drop them if everything
> else is fine.
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index a708c3448809..92c992eb73d5 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -3492,9 +3492,7 @@ int spi_nor_scan(struct spi_nor *nor, const char
> *name,
>  {
>         const struct flash_info *info;
>         struct device *dev = nor->dev;
> -       struct mtd_info *mtd = &nor->mtd;
>         int ret;
> -       int i;
>
>         ret = spi_nor_check(nor);
>         if (ret)


With these, 

Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Tudor Ambarus Jan. 29, 2024, 1:27 p.m. UTC | #4
On 1/29/24 13:26, Pratyush Yadav wrote:
> On Fri, Dec 15 2023, Tudor Ambarus wrote:
> 
>> I missed to drop some unused variables. Will drop them if everything
>> else is fine.
>>
>> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
>> index a708c3448809..92c992eb73d5 100644
>> --- a/drivers/mtd/spi-nor/core.c
>> +++ b/drivers/mtd/spi-nor/core.c
>> @@ -3492,9 +3492,7 @@ int spi_nor_scan(struct spi_nor *nor, const char
>> *name,
>>  {
>>         const struct flash_info *info;
>>         struct device *dev = nor->dev;
>> -       struct mtd_info *mtd = &nor->mtd;
>>         int ret;
>> -       int i;
>>
>>         ret = spi_nor_check(nor);
>>         if (ret)
> 
> 
> With these, 
> 
> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
> 
Hi, Pratyush,

All in these series were already applied, as I specified in a reply.
Please check patchwork for patches that are not yet handled.

Cheers,
ta
Pratyush Yadav Jan. 29, 2024, 1:34 p.m. UTC | #5
On Mon, Jan 29 2024, Tudor Ambarus wrote:

> On 1/29/24 13:26, Pratyush Yadav wrote:
>> On Fri, Dec 15 2023, Tudor Ambarus wrote:
>> 
>>> I missed to drop some unused variables. Will drop them if everything
>>> else is fine.
>>>
>>> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
>>> index a708c3448809..92c992eb73d5 100644
>>> --- a/drivers/mtd/spi-nor/core.c
>>> +++ b/drivers/mtd/spi-nor/core.c
>>> @@ -3492,9 +3492,7 @@ int spi_nor_scan(struct spi_nor *nor, const char
>>> *name,
>>>  {
>>>         const struct flash_info *info;
>>>         struct device *dev = nor->dev;
>>> -       struct mtd_info *mtd = &nor->mtd;
>>>         int ret;
>>> -       int i;
>>>
>>>         ret = spi_nor_check(nor);
>>>         if (ret)
>> 
>> 
>> With these, 
>> 
>> Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
>> 
> Hi, Pratyush,
>
> All in these series were already applied, as I specified in a reply.
> Please check patchwork for patches that are not yet handled.

Ah sorry, I didn't see that. I was browsing through my email backlog and
these patches just caught my eye.

Will look at the newer ones.
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index ca5bd93d1f17..a708c3448809 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3561,22 +3561,6 @@  int spi_nor_scan(struct spi_nor *nor, const char *name,
 	dev_dbg(dev, "Manufacturer and device ID: %*phN\n",
 		SPI_NOR_MAX_ID_LEN, nor->id);
 
-	dev_dbg(dev,
-		"mtd .name = %s, .size = 0x%llx (%lldMiB), "
-		".erasesize = 0x%.8x (%uKiB) .numeraseregions = %d\n",
-		mtd->name, (long long)mtd->size, (long long)(mtd->size >> 20),
-		mtd->erasesize, mtd->erasesize / 1024, mtd->numeraseregions);
-
-	if (mtd->numeraseregions)
-		for (i = 0; i < mtd->numeraseregions; i++)
-			dev_dbg(dev,
-				"mtd.eraseregions[%d] = { .offset = 0x%llx, "
-				".erasesize = 0x%.8x (%uKiB), "
-				".numblocks = %d }\n",
-				i, (long long)mtd->eraseregions[i].offset,
-				mtd->eraseregions[i].erasesize,
-				mtd->eraseregions[i].erasesize / 1024,
-				mtd->eraseregions[i].numblocks);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(spi_nor_scan);