IB/{rdmavt, hfi1, qib}: Remove get_card_name() downcall

rdmavt has a down call to client drivers to retrieve a crafted card
name.

This name should be the IB defined name.

Rather than craft the name each time it is needed, simply retrieve
the IB allocated name from the IB device.

Update the function name to reflect its application.

Clean up driver code to match this change.

Reviewed-by: Mike Marciniszyn <[email protected]>
Signed-off-by: Michael J. Ruhl <[email protected]>
Signed-off-by: Dennis Dalessandro <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
This commit is contained in:
Michael J. Ruhl 2017-12-18 19:56:44 -08:00 • committed by Doug Ledford
commit 06f2597f75
10 changed files with 16 additions and 33 deletions

View file

@ -227,13 +227,6 @@ struct rvt_driver_provided {
/* Passed to ib core registration. Callback to create syfs files */
int (*port_callback)(struct ib_device *, u8, struct kobject *);
/*
* Returns a string to represent the device for which is being
* registered. This is primarily used for error and debug messages on
* the console.
*/
const char * (*get_card_name)(struct rvt_dev_info *rdi);
/*
* Returns a pointer to the undelying hardware's PCI device. This is
* used to display information as to what hardware is being referenced
@ -432,6 +425,17 @@ static inline void rvt_set_ibdev_name(struct rvt_dev_info *rdi,
snprintf(rdi->ibdev.name, sizeof(rdi->ibdev.name), fmt, name, unit);
}
/**
* rvt_get_ibdev_name - return the IB name
* @rdi: rdmavt device
*
* Return the registered name of the device.
*/
static inline const char *rvt_get_ibdev_name(const struct rvt_dev_info *rdi)
{
return rdi->ibdev.name;
}
static inline struct rvt_pd *ibpd_to_rvtpd(struct ib_pd *ibpd)
{
return container_of(ibpd, struct rvt_pd, ibpd);