Skip to content

Commit

Permalink
pinctrl: cherryview: fix address_space_handler() argument
Browse files Browse the repository at this point in the history
commit d5301c9 upstream.

First argument of acpi_*_address_space_handler() APIs is acpi_handle of
the device, which is incorrectly passed in driver ->remove() path here.
Fix it by passing the appropriate argument and while at it, make both
API calls consistent using ACPI_HANDLE().

Fixes: a0b0285 ("pinctrl: cherryview: Add support for GMMR GPIO opregion")
Cc: stable@vger.kernel.org
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
raagjadav authored and gregkh committed Sep 19, 2023
1 parent b0fd3e2 commit aaf5e63
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/pinctrl/intel/pinctrl-cherryview.c
Expand Up @@ -1701,7 +1701,6 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
struct intel_community_context *cctx;
struct intel_community *community;
struct device *dev = &pdev->dev;
struct acpi_device *adev = ACPI_COMPANION(dev);
struct intel_pinctrl *pctrl;
acpi_status status;
unsigned int i;
Expand Down Expand Up @@ -1769,7 +1768,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
if (ret)
return ret;

status = acpi_install_address_space_handler(adev->handle,
status = acpi_install_address_space_handler(ACPI_HANDLE(dev),
community->acpi_space_id,
chv_pinctrl_mmio_access_handler,
NULL, pctrl);
Expand All @@ -1786,7 +1785,7 @@ static int chv_pinctrl_remove(struct platform_device *pdev)
struct intel_pinctrl *pctrl = platform_get_drvdata(pdev);
const struct intel_community *community = &pctrl->communities[0];

acpi_remove_address_space_handler(ACPI_COMPANION(&pdev->dev),
acpi_remove_address_space_handler(ACPI_HANDLE(&pdev->dev),
community->acpi_space_id,
chv_pinctrl_mmio_access_handler);

Expand Down

0 comments on commit aaf5e63

Please sign in to comment.