/* If the driver does not implement protection, we show the default
* state of is_protected array - usually protection state unknown */
- if (p->driver->protect_check == NULL) {
+ if (!p->driver->protect_check) {
retval = ERROR_FLASH_OPER_UNSUPPORTED;
} else {
/* We must query the hardware to avoid printing stale information! */
protect_state);
}
- if (p->driver->info != NULL) {
+ if (p->driver->info) {
/* Let the flash driver print extra custom info */
retval = p->driver->info(p, CMD);
command_print_sameline(CMD, "\n");
}
/* check the flash bank name is unique */
- if (get_flash_bank_by_name_noprobe(bank_name) != NULL) {
+ if (get_flash_bank_by_name_noprobe(bank_name)) {
/* flash bank name already exists */
LOG_ERROR("flash bank name '%s' already exists", bank_name);
return ERROR_FAIL;