Skip to content

Commit

Permalink
qed: Delete unused parameter p_ptt from mcp APIs
Browse files Browse the repository at this point in the history
Since nvm images attributes are cached during driver load, acquiring ptt
is not needed when calling qed_mcp_get_nvm_image().

Signed-off-by: Denis Bolotin <denis.bolotin@cavium.com>
Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis Bolotin authored and David S. Miller committed Apr 23, 2018
1 parent 5f0456b commit b60bfdf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
9 changes: 1 addition & 8 deletions drivers/net/ethernet/qlogic/qed/qed_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1894,15 +1894,8 @@ static int qed_nvm_get_image(struct qed_dev *cdev, enum qed_nvm_images type,
u8 *buf, u16 len)
{
struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev);
struct qed_ptt *ptt = qed_ptt_acquire(hwfn);
int rc;

if (!ptt)
return -EAGAIN;

rc = qed_mcp_get_nvm_image(hwfn, ptt, type, buf, len);
qed_ptt_release(hwfn, ptt);
return rc;
return qed_mcp_get_nvm_image(hwfn, type, buf, len);
}

static int qed_set_coalesce(struct qed_dev *cdev, u16 rx_coal, u16 tx_coal,
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/ethernet/qlogic/qed/qed_mcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,6 @@ int qed_mcp_nvm_info_populate(struct qed_hwfn *p_hwfn)

static int
qed_mcp_get_nvm_image_att(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
enum qed_nvm_images image_id,
struct qed_nvm_image_att *p_image_att)
{
Expand Down Expand Up @@ -2569,7 +2568,6 @@ qed_mcp_get_nvm_image_att(struct qed_hwfn *p_hwfn,
}

int qed_mcp_get_nvm_image(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
enum qed_nvm_images image_id,
u8 *p_buffer, u32 buffer_len)
{
Expand All @@ -2578,7 +2576,7 @@ int qed_mcp_get_nvm_image(struct qed_hwfn *p_hwfn,

memset(p_buffer, 0, buffer_len);

rc = qed_mcp_get_nvm_image_att(p_hwfn, p_ptt, image_id, &image_att);
rc = qed_mcp_get_nvm_image_att(p_hwfn, image_id, &image_att);
if (rc)
return rc;

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/qlogic/qed/qed_mcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,13 @@ struct qed_nvm_image_att {
* @brief Allows reading a whole nvram image
*
* @param p_hwfn
* @param p_ptt
* @param image_id - image requested for reading
* @param p_buffer - allocated buffer into which to fill data
* @param buffer_len - length of the allocated buffer.
*
* @return 0 iff p_buffer now contains the nvram image.
*/
int qed_mcp_get_nvm_image(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt,
enum qed_nvm_images image_id,
u8 *p_buffer, u32 buffer_len);

Expand Down

0 comments on commit b60bfdf

Please sign in to comment.