sparc64: Limit nvme of_path_of_nvme to just SPARC
Limit NVMe of_path_of_nvme to just SPARC hardware for now. It has been found that non-Open Firmware hardware platforms can some how access this function. Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
455dda2544
commit
21b89650ec
1 changed files with 4 additions and 0 deletions
|
@ -350,6 +350,7 @@ of_path_of_ide(const char *sys_devname __attribute__((unused)), const char *devi
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __sparc__
|
||||||
static char *
|
static char *
|
||||||
of_path_of_nvme(const char *sys_devname __attribute__((unused)),
|
of_path_of_nvme(const char *sys_devname __attribute__((unused)),
|
||||||
const char *device,
|
const char *device,
|
||||||
|
@ -396,6 +397,7 @@ of_path_of_nvme(const char *sys_devname __attribute__((unused)),
|
||||||
free (sysfs_path);
|
free (sysfs_path);
|
||||||
return of_path;
|
return of_path;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vendor_is_ATA(const char *path)
|
vendor_is_ATA(const char *path)
|
||||||
|
@ -728,9 +730,11 @@ grub_util_devname_to_ofpath (const char *sys_devname)
|
||||||
/* All the models I've seen have a devalias "floppy".
|
/* All the models I've seen have a devalias "floppy".
|
||||||
New models have no floppy at all. */
|
New models have no floppy at all. */
|
||||||
ofpath = xstrdup ("floppy");
|
ofpath = xstrdup ("floppy");
|
||||||
|
#ifdef __sparc__
|
||||||
else if (device[0] == 'n' && device[1] == 'v' && device[2] == 'm'
|
else if (device[0] == 'n' && device[1] == 'v' && device[2] == 'm'
|
||||||
&& device[3] == 'e')
|
&& device[3] == 'e')
|
||||||
ofpath = of_path_of_nvme (name_buf, device, devnode, devicenode);
|
ofpath = of_path_of_nvme (name_buf, device, devnode, devicenode);
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
grub_util_warn (_("unknown device type %s"), device);
|
grub_util_warn (_("unknown device type %s"), device);
|
||||||
|
|
Loading…
Reference in a new issue