Thread (91 messages) 91 messages, 15 authors, 2023-11-13

Re: [PATCH v3 24/42] mtd: nand: add support for ts72xx

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2023-07-24 07:09:24
Also in: alsa-devel, dmaengine, linux-clk, linux-devicetree, linux-gpio, linux-ide, linux-input, linux-pm, linux-pwm, linux-rtc, linux-spi, linux-watchdog, lkml

Hi Andy,
quoted
+static int ts72xx_nand_attach_chip(struct nand_chip *chip)
+{
+	switch (chip->ecc.engine_type) {
+	case NAND_ECC_ENGINE_TYPE_SOFT:
+		if (chip->ecc.algo == NAND_ECC_ALGO_UNKNOWN)
+			chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
+		break;
+	case NAND_ECC_ENGINE_TYPE_ON_HOST:
+		return -EINVAL;
+	default:  
quoted
+		break;  
Here it will return 0, is it a problem?
Seems ok, there are two other situations: on-die ECC engine and no ECC
engine, both do not require any specific handling on the controller
side.
quoted
+	}
+
+	return 0;
+}  
...
quoted
+static void ts72xx_nand_remove(struct platform_device *pdev)
+{
+	struct ts72xx_nand_data *data = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &data->chip;
+	int ret;
+
+	ret = mtd_device_unregister(nand_to_mtd(chip));  
quoted
+	WARN_ON(ret);  
Why?!  Is it like this in other MTD drivers?
Yes, we did not yet change the internal machinery to return void, and
we don't want people to think getting errors there is normal.
quoted
+	nand_cleanup(chip);
+}  
Thanks,
Miquèl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help