提交 21434966 编写于 作者: D Darrick J. Wong 提交者: James Bottomley

[SCSI] libsas: Check return values of sysfs_create_link

Get rid of: "warning: ignoring return value of sysfs_create_link..."
Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 6f63caae
...@@ -625,8 +625,19 @@ static void sas_port_release(struct device *dev) ...@@ -625,8 +625,19 @@ static void sas_port_release(struct device *dev)
static void sas_port_create_link(struct sas_port *port, static void sas_port_create_link(struct sas_port *port,
struct sas_phy *phy) struct sas_phy *phy)
{ {
sysfs_create_link(&port->dev.kobj, &phy->dev.kobj, phy->dev.bus_id); int res;
sysfs_create_link(&phy->dev.kobj, &port->dev.kobj, "port");
res = sysfs_create_link(&port->dev.kobj, &phy->dev.kobj,
phy->dev.bus_id);
if (res)
goto err;
res = sysfs_create_link(&phy->dev.kobj, &port->dev.kobj, "port");
if (res)
goto err;
return;
err:
printk(KERN_ERR "%s: Cannot create port links, err=%d\n",
__FUNCTION__, res);
} }
static void sas_port_delete_link(struct sas_port *port, static void sas_port_delete_link(struct sas_port *port,
...@@ -864,13 +875,20 @@ EXPORT_SYMBOL(sas_port_delete_phy); ...@@ -864,13 +875,20 @@ EXPORT_SYMBOL(sas_port_delete_phy);
void sas_port_mark_backlink(struct sas_port *port) void sas_port_mark_backlink(struct sas_port *port)
{ {
int res;
struct device *parent = port->dev.parent->parent->parent; struct device *parent = port->dev.parent->parent->parent;
if (port->is_backlink) if (port->is_backlink)
return; return;
port->is_backlink = 1; port->is_backlink = 1;
sysfs_create_link(&port->dev.kobj, &parent->kobj, res = sysfs_create_link(&port->dev.kobj, &parent->kobj,
parent->bus_id); parent->bus_id);
if (res)
goto err;
return;
err:
printk(KERN_ERR "%s: Cannot create port backlink, err=%d\n",
__FUNCTION__, res);
} }
EXPORT_SYMBOL(sas_port_mark_backlink); EXPORT_SYMBOL(sas_port_mark_backlink);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册