summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2020-10-14 11:59:36 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2020-10-14 11:59:36 +0200
commitc7826d812d44a1ed7fd920955c4b84759eda92e5 (patch)
tree08da81ddcc4bc7a3afc363f521022d2e3d33ea20 /drivers/mtd
parent5e6d1fa110b34b340b6fcfb790855799c51499f7 (diff)
parent08e290674368862e4e5af76418ca5b0db7392030 (diff)
Merge 4.4.239 into android-4.4-p
Changes in 4.4.239 gpio: tc35894: fix up tc35894 interrupt configuration Input: i8042 - add nopnp quirk for Acer Aspire 5 A515 drm/amdgpu: restore proper ref count in amdgpu_display_crtc_set_config net: dec: de2104x: Increase receive ring size for Tulip rndis_host: increase sleep time in the query-response loop drivers/net/wan/lapbether: Make skb->protocol consistent with the header drivers/net/wan/hdlc: Set skb->protocol before transmitting nfs: Fix security label length not being reset clk: samsung: exynos4: mark 'chipid' clock as CLK_IGNORE_UNUSED iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate() i2c: cpm: Fix i2c_ram structure epoll: do not insert into poll queues until all sanity checks are done epoll: replace ->visited/visited_list with generation count epoll: EPOLL_CTL_ADD: close the race in decision to take fast path ep_create_wakeup_source(): dentry name can change under you... netfilter: ctnetlink: add a range check for l3/l4 protonum fbdev, newport_con: Move FONT_EXTRA_WORDS macros into linux/font.h Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts Revert "ravb: Fixed to be able to unload modules" fbcon: Fix global-out-of-bounds read in fbcon_get_font() net: wireless: nl80211: fix out-of-bounds access in nl80211_del_key() usermodehelper: reset umask to default before executing user process platform/x86: thinkpad_acpi: initialize tp_nvram_state variable platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse driver core: Fix probe_count imbalance in really_probe() perf top: Fix stdio interface input handling with glibc 2.28+ sctp: fix sctp_auth_init_hmacs() error path team: set dev->needed_headroom in team_setup_by_port() net: team: fix memory leak in __team_options_register mtd: nand: Provide nand_cleanup() function to free NAND related resources xfrm: clone XFRMA_REPLAY_ESN_VAL in xfrm_do_migrate xfrm: clone whole liftime_cur structure in xfrm_do_migrate net: stmmac: removed enabling eee in EEE set callback xfrm: Use correct address family in xfrm_state_find bonding: set dev->needed_headroom in bond_setup_by_slave() rxrpc: Fix rxkad token xdr encoding rxrpc: Downgrade the BUG() for unsupported token type in rxrpc_read() rxrpc: Fix server keyring leak net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails Linux 4.4.239 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Iac33b64c570b076bdc997d9778628d2ffbc3fef0
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_base.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 8406f346b0be..09864226428b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -4427,18 +4427,14 @@ int nand_scan(struct mtd_info *mtd, int maxchips)
EXPORT_SYMBOL(nand_scan);
/**
- * nand_release - [NAND Interface] Free resources held by the NAND device
- * @mtd: MTD device structure
+ * nand_cleanup - [NAND Interface] Free resources held by the NAND device
+ * @chip: NAND chip object
*/
-void nand_release(struct mtd_info *mtd)
+void nand_cleanup(struct nand_chip *chip)
{
- struct nand_chip *chip = mtd->priv;
-
if (chip->ecc.mode == NAND_ECC_SOFT_BCH)
nand_bch_free((struct nand_bch_control *)chip->ecc.priv);
- mtd_device_unregister(mtd);
-
/* Free bad block table memory */
kfree(chip->bbt);
if (!(chip->options & NAND_OWN_BUFFERS))
@@ -4449,6 +4445,18 @@ void nand_release(struct mtd_info *mtd)
& NAND_BBT_DYNAMICSTRUCT)
kfree(chip->badblock_pattern);
}
+EXPORT_SYMBOL_GPL(nand_cleanup);
+
+/**
+ * nand_release - [NAND Interface] Unregister the MTD device and free resources
+ * held by the NAND device
+ * @mtd: MTD device structure
+ */
+void nand_release(struct mtd_info *mtd)
+{
+ mtd_device_unregister(mtd);
+ nand_cleanup(mtd->priv);
+}
EXPORT_SYMBOL_GPL(nand_release);
static int __init nand_base_init(void)