| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * BCM47XX NAND flash driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2012 Rafał Miłecki <zajec5@gmail.com> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #include "bcm47xxnflash.h" |
|---|
| .. | .. |
|---|
| 64 | 60 | static int bcm47xxnflash_remove(struct platform_device *pdev) |
|---|
| 65 | 61 | { |
|---|
| 66 | 62 | struct bcm47xxnflash *nflash = platform_get_drvdata(pdev); |
|---|
| 63 | + struct nand_chip *chip = &nflash->nand_chip; |
|---|
| 64 | + int ret; |
|---|
| 67 | 65 | |
|---|
| 68 | | - nand_release(&nflash->nand_chip); |
|---|
| 66 | + ret = mtd_device_unregister(nand_to_mtd(chip)); |
|---|
| 67 | + WARN_ON(ret); |
|---|
| 68 | + nand_cleanup(chip); |
|---|
| 69 | 69 | |
|---|
| 70 | 70 | return 0; |
|---|
| 71 | 71 | } |
|---|