Skip to content

Commit 9444775

Browse files
committed
Merge tag 'nand/for-6.13' into mtd/next
SPI-NAND changes: A load of fixes to Winbond manufacturer driver have been done, plus a structure constification. Raw NAND changes: The GPMI driver has been improved on the power management side. The Davinci driver has been cleaned up. A leak in the Atmel driver plus some typos in the core have been fixed.
2 parents 34267d3 + af264e5 commit 9444775

21 files changed

+139
-128
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9028,6 +9028,7 @@ F: drivers/net/ethernet/freescale/gianfar*
90289028

90299029
FREESCALE GPMI NAND DRIVER
90309030
M: Han Xu <han.xu@nxp.com>
9031+
L: imx@lists.linux.dev
90319032
L: linux-mtd@lists.infradead.org
90329033
S: Maintained
90339034
F: drivers/mtd/nand/raw/gpmi-nand/*

drivers/mtd/nand/ecc-mxic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,21 +723,21 @@ static int mxic_ecc_finish_io_req_pipelined(struct nand_device *nand,
723723
return ret;
724724
}
725725

726-
static struct nand_ecc_engine_ops mxic_ecc_engine_external_ops = {
726+
static const struct nand_ecc_engine_ops mxic_ecc_engine_external_ops = {
727727
.init_ctx = mxic_ecc_init_ctx_external,
728728
.cleanup_ctx = mxic_ecc_cleanup_ctx,
729729
.prepare_io_req = mxic_ecc_prepare_io_req_external,
730730
.finish_io_req = mxic_ecc_finish_io_req_external,
731731
};
732732

733-
static struct nand_ecc_engine_ops mxic_ecc_engine_pipelined_ops = {
733+
static const struct nand_ecc_engine_ops mxic_ecc_engine_pipelined_ops = {
734734
.init_ctx = mxic_ecc_init_ctx_pipelined,
735735
.cleanup_ctx = mxic_ecc_cleanup_ctx,
736736
.prepare_io_req = mxic_ecc_prepare_io_req_pipelined,
737737
.finish_io_req = mxic_ecc_finish_io_req_pipelined,
738738
};
739739

740-
struct nand_ecc_engine_ops *mxic_ecc_get_pipelined_ops(void)
740+
const struct nand_ecc_engine_ops *mxic_ecc_get_pipelined_ops(void)
741741
{
742742
return &mxic_ecc_engine_pipelined_ops;
743743
}

drivers/mtd/nand/ecc-sw-bch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static int nand_ecc_sw_bch_finish_io_req(struct nand_device *nand,
384384
return max_bitflips;
385385
}
386386

387-
static struct nand_ecc_engine_ops nand_ecc_sw_bch_engine_ops = {
387+
static const struct nand_ecc_engine_ops nand_ecc_sw_bch_engine_ops = {
388388
.init_ctx = nand_ecc_sw_bch_init_ctx,
389389
.cleanup_ctx = nand_ecc_sw_bch_cleanup_ctx,
390390
.prepare_io_req = nand_ecc_sw_bch_prepare_io_req,

drivers/mtd/nand/ecc-sw-hamming.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ static int nand_ecc_sw_hamming_finish_io_req(struct nand_device *nand,
638638
return max_bitflips;
639639
}
640640

641-
static struct nand_ecc_engine_ops nand_ecc_sw_hamming_engine_ops = {
641+
static const struct nand_ecc_engine_ops nand_ecc_sw_hamming_engine_ops = {
642642
.init_ctx = nand_ecc_sw_hamming_init_ctx,
643643
.cleanup_ctx = nand_ecc_sw_hamming_cleanup_ctx,
644644
.prepare_io_req = nand_ecc_sw_hamming_prepare_io_req,

drivers/mtd/nand/raw/atmel/pmecc.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ atmel_pmecc_create_user(struct atmel_pmecc *pmecc,
362362
size = ALIGN(size, sizeof(s32));
363363
size += (req->ecc.strength + 1) * sizeof(s32) * 3;
364364

365-
user = kzalloc(size, GFP_KERNEL);
365+
user = devm_kzalloc(pmecc->dev, size, GFP_KERNEL);
366366
if (!user)
367367
return ERR_PTR(-ENOMEM);
368368

@@ -408,12 +408,6 @@ atmel_pmecc_create_user(struct atmel_pmecc *pmecc,
408408
}
409409
EXPORT_SYMBOL_GPL(atmel_pmecc_create_user);
410410

411-
void atmel_pmecc_destroy_user(struct atmel_pmecc_user *user)
412-
{
413-
kfree(user);
414-
}
415-
EXPORT_SYMBOL_GPL(atmel_pmecc_destroy_user);
416-
417411
static int get_strength(struct atmel_pmecc_user *user)
418412
{
419413
const int *strengths = user->pmecc->caps->strengths;

drivers/mtd/nand/raw/atmel/pmecc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ struct atmel_pmecc *devm_atmel_pmecc_get(struct device *dev);
5555
struct atmel_pmecc_user *
5656
atmel_pmecc_create_user(struct atmel_pmecc *pmecc,
5757
struct atmel_pmecc_user_req *req);
58-
void atmel_pmecc_destroy_user(struct atmel_pmecc_user *user);
59-
6058
void atmel_pmecc_reset(struct atmel_pmecc *pmecc);
6159
int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op);
6260
void atmel_pmecc_disable(struct atmel_pmecc_user *user);

drivers/mtd/nand/raw/brcmnand/brcmnand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ static int write_oob_to_regs(struct brcmnand_controller *ctrl, int i,
15611561
(oob[j + 2] << 8) |
15621562
(oob[j + 3] << 0));
15631563

1564-
/* handle the remaing bytes */
1564+
/* handle the remaining bytes */
15651565
while (j < tbytes)
15661566
plast[k++] = oob[j++];
15671567

drivers/mtd/nand/raw/cadence-nand-controller.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ static int cadence_nand_read_buf(struct cdns_nand_ctrl *cdns_ctrl,
18911891

18921892
int len_in_words = (data_dma_width == 4) ? len >> 2 : len >> 3;
18931893

1894-
/* read alingment data */
1894+
/* read alignment data */
18951895
if (data_dma_width == 4)
18961896
ioread32_rep(cdns_ctrl->io.virt, buf, len_in_words);
18971897
#ifdef CONFIG_64BIT

drivers/mtd/nand/raw/cs553x_nand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#define NR_CS553X_CONTROLLERS 4
2828

29-
#define MSR_DIVIL_GLD_CAP 0x51400000 /* DIVIL capabilitiies */
29+
#define MSR_DIVIL_GLD_CAP 0x51400000 /* DIVIL capabilities */
3030
#define CAP_CS5535 0x2df000ULL
3131
#define CAP_CS5536 0x5df500ULL
3232

drivers/mtd/nand/raw/davinci_nand.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
* Dirk Behme <Dirk.Behme@gmail.com>
1111
*/
1212

13-
#include <linux/kernel.h>
14-
#include <linux/module.h>
15-
#include <linux/platform_device.h>
1613
#include <linux/err.h>
1714
#include <linux/iopoll.h>
18-
#include <linux/mtd/rawnand.h>
15+
#include <linux/kernel.h>
16+
#include <linux/module.h>
1917
#include <linux/mtd/partitions.h>
18+
#include <linux/mtd/rawnand.h>
19+
#include <linux/platform_device.h>
20+
#include <linux/property.h>
2021
#include <linux/slab.h>
21-
#include <linux/of.h>
2222

2323
#define NRCSR_OFFSET 0x00
2424
#define NANDFCR_OFFSET 0x60
@@ -487,10 +487,10 @@ static const struct of_device_id davinci_nand_of_match[] = {
487487
};
488488
MODULE_DEVICE_TABLE(of, davinci_nand_of_match);
489489

490-
static struct davinci_nand_pdata
491-
*nand_davinci_get_pdata(struct platform_device *pdev)
490+
static struct davinci_nand_pdata *
491+
nand_davinci_get_pdata(struct platform_device *pdev)
492492
{
493-
if (!dev_get_platdata(&pdev->dev) && pdev->dev.of_node) {
493+
if (!dev_get_platdata(&pdev->dev)) {
494494
struct davinci_nand_pdata *pdata;
495495
const char *mode;
496496
u32 prop;
@@ -501,40 +501,42 @@ static struct davinci_nand_pdata
501501
pdev->dev.platform_data = pdata;
502502
if (!pdata)
503503
return ERR_PTR(-ENOMEM);
504-
if (!of_property_read_u32(pdev->dev.of_node,
505-
"ti,davinci-chipselect", &prop))
504+
if (!device_property_read_u32(&pdev->dev,
505+
"ti,davinci-chipselect", &prop))
506506
pdata->core_chipsel = prop;
507507
else
508508
return ERR_PTR(-EINVAL);
509509

510-
if (!of_property_read_u32(pdev->dev.of_node,
511-
"ti,davinci-mask-ale", &prop))
510+
if (!device_property_read_u32(&pdev->dev,
511+
"ti,davinci-mask-ale", &prop))
512512
pdata->mask_ale = prop;
513-
if (!of_property_read_u32(pdev->dev.of_node,
514-
"ti,davinci-mask-cle", &prop))
513+
if (!device_property_read_u32(&pdev->dev,
514+
"ti,davinci-mask-cle", &prop))
515515
pdata->mask_cle = prop;
516-
if (!of_property_read_u32(pdev->dev.of_node,
517-
"ti,davinci-mask-chipsel", &prop))
516+
if (!device_property_read_u32(&pdev->dev,
517+
"ti,davinci-mask-chipsel", &prop))
518518
pdata->mask_chipsel = prop;
519-
if (!of_property_read_string(pdev->dev.of_node,
520-
"ti,davinci-ecc-mode", &mode)) {
519+
if (!device_property_read_string(&pdev->dev,
520+
"ti,davinci-ecc-mode",
521+
&mode)) {
521522
if (!strncmp("none", mode, 4))
522523
pdata->engine_type = NAND_ECC_ENGINE_TYPE_NONE;
523524
if (!strncmp("soft", mode, 4))
524525
pdata->engine_type = NAND_ECC_ENGINE_TYPE_SOFT;
525526
if (!strncmp("hw", mode, 2))
526527
pdata->engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST;
527528
}
528-
if (!of_property_read_u32(pdev->dev.of_node,
529-
"ti,davinci-ecc-bits", &prop))
529+
if (!device_property_read_u32(&pdev->dev,
530+
"ti,davinci-ecc-bits", &prop))
530531
pdata->ecc_bits = prop;
531532

532-
if (!of_property_read_u32(pdev->dev.of_node,
533-
"ti,davinci-nand-buswidth", &prop) && prop == 16)
533+
if (!device_property_read_u32(&pdev->dev,
534+
"ti,davinci-nand-buswidth",
535+
&prop) && prop == 16)
534536
pdata->options |= NAND_BUSWIDTH_16;
535537

536-
if (of_property_read_bool(pdev->dev.of_node,
537-
"ti,davinci-nand-use-bbt"))
538+
if (device_property_read_bool(&pdev->dev,
539+
"ti,davinci-nand-use-bbt"))
538540
pdata->bbt_options = NAND_BBT_USE_FLASH;
539541

540542
/*
@@ -548,17 +550,15 @@ static struct davinci_nand_pdata
548550
* then use "ti,davinci-nand" as the compatible in your
549551
* device-tree file.
550552
*/
551-
if (of_device_is_compatible(pdev->dev.of_node,
552-
"ti,keystone-nand")) {
553+
if (device_is_compatible(&pdev->dev, "ti,keystone-nand"))
553554
pdata->options |= NAND_NO_SUBPAGE_WRITE;
554-
}
555555
}
556556

557557
return dev_get_platdata(&pdev->dev);
558558
}
559559
#else
560-
static struct davinci_nand_pdata
561-
*nand_davinci_get_pdata(struct platform_device *pdev)
560+
static struct davinci_nand_pdata *
561+
nand_davinci_get_pdata(struct platform_device *pdev)
562562
{
563563
return dev_get_platdata(&pdev->dev);
564564
}

0 commit comments

Comments
 (0)