struct Scsi_Host *host = class_to_shost(cdev);
struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata[0];
- if (!phba) return 0;
-
if (phba->fc_flag & FC_OFFLINE_MODE)
return snprintf(buf, PAGE_SIZE, "0\n");
else
int val=0, status=0;
if (sscanf(buf, "%d", &val) != 1)
- return 0;
+ return -EINVAL;
init_completion(&online_compl);
if (!status)
return strlen(buf);
else
- return 0;
+ return -EIO;
}
return snprintf(buf, PAGE_SIZE, "%d\n",\
phba->cfg_##attr);\
}\
- return 0;\
+ return -EPERM;\
}
#define lpfc_param_store(attr, minval, maxval) \
if (sscanf(buf, "0x%x", &val) != 1)\
if (sscanf(buf, "%d", &val) != 1)\
return -EINVAL;\
- if (phba){\
- if (val >= minval && val <= maxval) {\
- phba->cfg_##attr = val;\
- return strlen(buf);\
- }\
+ if (val >= minval && val <= maxval) {\
+ phba->cfg_##attr = val;\
+ return strlen(buf);\
}\
- return 0;\
+ return -EINVAL;\
}
#define LPFC_ATTR_R_NOINIT(name, desc) \