+// SPDX-License-Identifier: GPL-2.0-or-later
+
/***************************************************************************
* Copyright (C) 2007 by Dominic Rath <Dominic.Rath@gmx.de> *
* Copyright (C) 2002 Thomas Gleixner <tglx@linutronix.de> *
* Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
* *
* Partially based on drivers/mtd/nand_ids.c from Linux. *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
unsigned found = 0;
struct nand_device *nand;
- for (nand = nand_devices; NULL != nand; nand = nand->next) {
+ for (nand = nand_devices; nand; nand = nand->next) {
if (strcmp(nand->name, name) == 0)
return nand;
if (!flash_driver_name_matches(nand->controller->name, name))
if (nand->blocks[block].is_erased == 1)
nand->blocks[block].is_erased = 0;
- if (nand->use_raw || nand->controller->write_page == NULL)
+ if (nand->use_raw || !nand->controller->write_page)
return nand_write_page_raw(nand, page, data, data_size, oob, oob_size);
else
return nand->controller->write_page(nand, page, data, data_size, oob, oob_size);
if (!nand->device)
return ERROR_NAND_DEVICE_NOT_PROBED;
- if (nand->use_raw || nand->controller->read_page == NULL)
+ if (nand->use_raw || !nand->controller->read_page)
return nand_read_page_raw(nand, page, data, data_size, oob, oob_size);
else
return nand->controller->read_page(nand, page, data, data_size, oob, oob_size);
{
int retval = ERROR_NAND_NO_BUFFER;
- if (nand->controller->read_block_data != NULL)
+ if (nand->controller->read_block_data)
retval = (nand->controller->read_block_data)(nand, data, size);
if (retval == ERROR_NAND_NO_BUFFER) {
{
int retval = ERROR_NAND_NO_BUFFER;
- if (nand->controller->write_block_data != NULL)
+ if (nand->controller->write_block_data)
retval = (nand->controller->write_block_data)(nand, data, size);
if (retval == ERROR_NAND_NO_BUFFER) {