aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2015-12-18mtd: nand: nandsim: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-6/+6
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: mxc: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-3/+2
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: mpc5121: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-2/+1
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: lpc32xx: use the mtd instance embedded in struct nand_chipBoris BREZILLON2-8/+6
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: jz4740: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-5/+4
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: hisi504: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-7/+6
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: gpmi: use the mtd instance embedded in struct nand_chipBoris BREZILLON3-14/+12
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: gpio: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-9/+12
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: fsmc: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-12/+10
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: fsl_upm: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-13/+16
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: fsl_ifc: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-12/+16
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: fsl_elbc: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-11/+15
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: docg4: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-11/+12
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: diskonchip: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-7/+7
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: davinci: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-14/+16
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: cmx270: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-9/+5
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> [Brian: dropped a defunct comment] Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: cs553x: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-9/+8
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: cafe: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-5/+5
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: brcm: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-7/+6
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: bf5xx: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-6/+6
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: au1550nd: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-8/+11
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: atmel: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-6/+7
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: ams-delta: use the mtd instance embedded in struct nand_chipBoris BREZILLON1-8/+5
struct nand_chip now embeds an mtd device. Make use of this mtd instance instead of allocating our own. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: omap2: create and use mtd_to_omap()Boris BREZILLON1-34/+21
Define and use mtd_to_omap() instead of container_of(); Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: nuc900: create and use mtd_to_nuc900()Boris BREZILLON1-15/+10
Create and use mtd_to_nuc900() instead of direct container_of() calls. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: nand: fsmc: create and use mtd_to_fsmc()Boris BREZILLON1-17/+14
Create and use mtd_to_fsmc() to avoid duplication of container_of(mtd, struct fsmc_nand_data, mtd) calls. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-18mtd: omap_elm: print interrupt resource using %prArnd Bergmann1-1/+1
When CONFIG_LPAE is set on ARM, resource_size_t is 64-bit wide and we get a warning about an incorrect format string for printing the interrupt number in elm_probe: drivers/mtd/nand/omap_elm.c: In function 'elm_probe': drivers/mtd/nand/omap_elm.c:417:23: warning: format '%i' expects argument of type 'int', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=] This patch avoids the type mismatch by printing the interrupt as a resource using the %pr format string. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-14mtd: bcm47xxnflash: really unregister NAND on device removalBrian Norris1-3/+4
The field bcma_nflash::mtd is never set to be non-zero anywhere, but we test for it in the removal path. So the MTD is never unregistered. Also, we should use nand_release(), not mtd_device_unregister(). Finally, we don't need to use the 'platdata' for stashing/retrieving our *driver* data -- that's what *_{get,set}_drvdata() are for. So, kill off bcm_nflash::mtd, and stash the struct bcm47xxnflash in drvdata instead. Also move the forward declaration of mtd_info up a bit, since struct bcma_sflash should be using it. Caught while inspecting other changes being made to this driver. Compile tested only. Signed-off-by: Brian Norris <[email protected]> Cc: "Rafał Miłecki" <[email protected]> Cc: [email protected] Acked-by: Boris Brezillon <[email protected]>
2015-12-11mtd: nand: denali: add missing nand_release() call in denali_remove()Boris BREZILLON1-2/+9
Unregister the NAND device from the NAND subsystem when removing a denali NAND controller, otherwise the MTD attached to the NAND device is still exposed by the MTD layer, and accesses to this device will likely crash the system. Fixes: 2a0a288ec258 ("mtd: denali: split the generic driver and PCI layer") Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Dinh Nguyen <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-10mtd: brcmnand: defer to devm_ioremap_resource() for error checkingBrian Norris1-3/+0
devm_ioremap_resource() does error checking on the 'res' argument, so drop the error check in bcm6368_nand.c. Signed-off-by: Brian Norris <[email protected]> Tested-by: Simon Arlott <[email protected]>
2015-12-09mtd: brcmnand: Add support for the BCM6368Simon Arlott2-0/+146
The BCM6368 has a NAND interrupt register with combined status and enable registers. As the BCM6328, BCM6362 and BCM6368 all use v2.1 controllers, the first variant that will work with this driver is the BCM63268 using a v4.0 controller. Set up the device by disabling and acking all interrupts, then handle the CTRL_READY interrupt. Signed-off-by: Simon Arlott <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-09mtd: brcmnand: Request and enable the clock if presentSimon Arlott1-14/+50
Attempt to enable a clock named "nand" as some SoCs have a clock for the controller that needs to be enabled. Signed-off-by: Simon Arlott <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-09mtd: nand: Confine MTD_NAND_SH_FLCTL to SUPERHGeert Uytterhoeven1-1/+1
As of commit a521422ea4ae6128 ("ARM: shmobile: mackerel: Remove Legacy C board code"), the Renesas SuperH FLCTL driver is no longer used on ARM SH-Mobile SoCs. Restrict the dependencies, unless compile-testing. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-09mtd: spi-nor: Check the return value from read_sr()Fabio Estevam1-2/+8
We should better check the return value from read_sr() and propagate it in the case of error. Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-09mtd: partitions: support a cleanup callback for parsersBrian Norris3-4/+36
If partition parsers need to clean up their resources, we shouldn't assume that all memory will fit in a single kmalloc() that the caller can kfree(). We should allow the parser to provide a proper cleanup routine. Note that this means we need to keep a hold on the parser's module for a bit longer, and release it later with mtd_part_parser_put(). Alongside this, define a default callback that we'll automatically use if the parser doesn't provide one, so we can still retain the old behavior. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
2015-12-09mtd: partitions: pass around 'mtd_partitions' wrapper structBrian Norris3-22/+31
For some of the core partitioning code, it helps to keep info about the parsed partition (and who parsed them) together in one place. Signed-off-by: Brian Norris <[email protected]>
2015-12-09mtd: partitions: remove kmemdup()Brian Norris3-11/+9
The use of kmemdup() complicates the error handling a bit. We don't actually need to allocate new memory, since this reference is treated as const, and it is copied into new memory by the partition registration code anyway. So remove it. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
2015-12-09mtd: partitions: rename MTD parser get/putBrian Norris1-5/+8
We're going to reuse put_partition_parser(), so let's fix up the prefix naming a bit, to hopefully be more consistent. Also make convert to a true C function instead of a macro. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
2015-12-09mtd: partitions: make parsers return 'const' partition arraysBrian Norris7-8/+8
We only want to modify these arrays inside the parser "drivers", so the drivers should construct them however they like, then return them as immutable arrays. This will make other refactorings easier. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
2015-12-09mtd: ofpart: assign return argument exactly onceBrian Norris1-16/+19
It's easier to refactor these parsers if the return value gets assigned only once, just like every other MTD partition parser. This prepares for making the second arg to the parse_fn() const. This is OK if we construct the partitions completely first, and assign them to the return pointer only after we're done modifying them. Signed-off-by: Brian Norris <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
2015-12-09mtd: merge for-4.4 development into -next developmentBrian Norris1-2/+10
A few MAINTAINERS updates, and some DT binding/documentation fixups. Signed-off-by: Brian Norris <[email protected]>
2015-12-08doc: dt: mtd: partitions: add compatible property to "partitions" nodeBrian Norris1-0/+3
As noted here [1], there are potentially future conflicts if we try to use MTD's "partitions" subnode to describe anything besides just the fixed-in-the-device-tree partitions currently described in this document. Particularly, there was a proposal to use this node for the AFS parser too. It can pose a (small) problem to try to differentiate the following nodes: // using binding as currently specified partitions { #address-cells = <x>; #size-cells = <y>; partition@0 { ...; }; }; and // proposed future binding partitions { compatible = "arm,arm-flash-structure"; }; It's especially difficult if other uses of this node start having subnodes. So, since the "partitions" node is new in v4.4, let's fixup the binding before release so that it requires a compatible property, so it's much clearer to distinguish. e.g.: // proposed partitions { compatible = "fixed-partitions"; #address-cells = <x>; #size-cells = <y>; partition@0 { ...; }; }; [1] Subject: "mtd: create a partition type device tree binding" http://lkml.kernel.org/g/[email protected] http://lists.infradead.org/pipermail/linux-mtd/2015-November/063355.html http://lists.infradead.org/pipermail/linux-mtd/2015-November/063364.html Cc: Michal Suchanek <[email protected]> Signed-off-by: Brian Norris <[email protected]> Acked-by: Rob Herring <[email protected]>
2015-12-08mtd: nand: make use of mtd_to_nand() in NAND driversBoris BREZILLON38-276/+276
mtd_to_nand() was recently introduced to avoid direct accesses to the mtd->priv field. Update all NAND drivers to use it. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-08staging: mt29f_spinand: make use of mtd_to_nand()Boris BREZILLON1-2/+2
mtd_to_nand() was recently introduced to avoid direct accesses to the mtd->priv field. Use it where appropriate. Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-08mtd: nand: make use of mtd_to_nand() in NAND core codeBoris BREZILLON5-71/+71
mtd_to_nand() was recently introduced to avoid direct access to the mtd->priv field. Update core code to use mtd_to_nand(). Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-04mtd: nand: r852: Remove unnecessary synchronize_irq() before free_irq()Lars-Peter Clausen1-1/+0
Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Patch was generated using the following semantic patch: // <smpl> @@ expression irq; @@ -synchronize_irq(irq); free_irq(irq, ...); // </smpl> Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-04mtd: spi-nor: fix error handling in spi_nor_eraseHeiner Kallweit1-6/+2
The documenting comment of mtd_erase in mtdcore.c states: Device drivers are supposed to call instr->callback() whenever the operation completes, even if it completes with a failure. Currently the callback isn't called in case of failure. Fix this. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Brian Norris <[email protected]>
2015-12-04mtd: mtk-quadspi: drop unnecessary .owner assignmentBrian Norris1-1/+0
As of commit 807f16d4db95 ("mtd: core: set some defaults when dev.parent is set"), the MTD core will set this for us. Signed-off-by: Brian Norris <[email protected]> Cc: Bayi Cheng <[email protected]>
2015-12-04mtd: partitions: turn PART() macro into inline functionBrian Norris1-30/+33
We can guard against reorganization of struct mtd_part by using container_of(). We can also make sure we're using the right pointer types by making this a static inline function instead of a macro. Signed-off-by: Brian Norris <[email protected]>
2015-12-03mtd: ofpart: don't complain about missing 'partitions' node too loudlyBrian Norris1-2/+7
The ofpart partition parser might be run on DT-enabled systems that don't have any "ofpart" partition subnodes at all, since "ofpart" is in the default parser list. So don't complain loudly on every boot. Example: using m25p80.c with no intent to use ofpart: &spi2 { status = "okay"; flash@0 { compatible = "jedec,spi-nor"; reg = <0>; }; }; I see this warning: [ 0.588471] m25p80 spi2.0: gd25q32 (4096 Kbytes) [ 0.593091] spi2.0: 'partitions' subnode not found on /spi@ff130000/flash@0. Trying to parse direct subnodes as partitions. Cc: Michal Suchanek <[email protected]> Signed-off-by: Brian Norris <[email protected]>