Vaibhav Jain <vaib...@linux.ibm.com> writes: >> +err_out: >> + dev_info(&p->pdev->dev, >> + "Failed to query, trying an unbind followed by bind"); >> + drc_pmem_unbind(p); >> + return drc_pmem_bind(p); >> +} > Would have preferred error handling for bind failure to be done at > single location i.e in papr_scm_probe() rather than in > drc_pmem_query_n_bind(). >
IMHO the final code looks simpler. /* request the hypervisor to bind this region to somewhere in memory */ rc = drc_pmem_bind(p); /* If phyp says drc memory still bound then force unbound and retry */ if (rc == H_OVERLAP) rc = drc_pmem_query_n_bind(p); if (rc != H_SUCCESS) { dev_err(&p->pdev->dev, "bind err: %d\n", rc); rc = -ENXIO; goto err; } -aneesh