This pull request includes a revert to fix a regression introduced this

merge window and a fix for proper error handling in the remove path of
 the iMX driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmMB7uEACgkQFA3kzBSg
 KbYvKg//RruLCRCyz7txzbQ+Wk3v4eBnKv0n0uekQe7u/Ku68MWEn5F+oqmYwjXI
 wCGOvXaXkDlPp1qeBmKLsGDodzWhgbnD5KREB5z8veffHCVne6IEF2A7bRlS77JB
 qGuq1nWFx++s3IzwF4mA4ZbVlk/UnoE9tAEu63SgFFugaunTuC9DelVufza8nsUU
 2K0fv+eKaZdxGCO8HJkAX9nKnxqZHYfYm1bSsH/rna0RGqBWhBxfqDVKVphzju0n
 wLB0s8gQzmR+QPqRIvoeZJHwoUZrFZGcZisOtB4LiGmyp23GIPocaEeOAyEd/9/o
 G6cZP5T8I1Wx03jOIQF3+y/a61lG+fOzDcWeH8LvE2Ku9XFY1pn70jWk69CZv/bw
 JfX+5XHOsP/llm1FNhV2VIIC3oIVdc0hDcrFLKLiPxOrVQ/DdYWlJLfYtXO6G0CU
 IHEHChZBpUGwE37Rb5f3NikVIMrRP4JvXUSRkAPQbW5Vsek/Z7QBf+8Ugba5D0Xh
 /qQQ11M7IZZCqXXJkDaOUdAFYF2dRkSwYDzp/Wtyu2Q6NzoosNkuRqQkExIrPhv1
 4ldwCy8hNkFG6kstlgJ3s8hx8DHvH6CK4mHMozXjMZ8FoUt1lOvuHPGWLsvHxPpl
 shKzjxUYFVuZxFr3487RK8978uO19khBA1FDt1OYj6Fbs8kfRDg=
 =aSFj
 -----END PGP SIGNATURE-----

Merge tag 'i2c-for-6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "A revert to fix a regression introduced this merge window and a fix
  for proper error handling in the remove path of the iMX driver"

* tag 'i2c-for-6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: imx: Make sure to unregister adapter on remove()
  Revert "i2c: scmi: Replace open coded device_get_match_data()"
This commit is contained in:
Linus Torvalds 2022-08-21 11:18:33 -07:00
commit e3f259d33c
2 changed files with 18 additions and 11 deletions

View File

@ -1572,9 +1572,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev);
int irq, ret;
ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret < 0)
return ret;
ret = pm_runtime_get_sync(&pdev->dev);
hrtimer_cancel(&i2c_imx->slave_timer);
@ -1585,17 +1583,21 @@ static int i2c_imx_remove(struct platform_device *pdev)
if (i2c_imx->dma)
i2c_imx_dma_free(i2c_imx);
/* setup chip registers to defaults */
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR);
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR);
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2CR);
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2SR);
if (ret == 0) {
/* setup chip registers to defaults */
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR);
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR);
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2CR);
imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2SR);
clk_disable(i2c_imx->clk);
}
clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb);
irq = platform_get_irq(pdev, 0);
if (irq >= 0)
free_irq(irq, i2c_imx);
clk_disable_unprepare(i2c_imx->clk);
clk_unprepare(i2c_imx->clk);
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);

View File

@ -30,7 +30,7 @@ struct acpi_smbus_cmi {
u8 cap_info:1;
u8 cap_read:1;
u8 cap_write:1;
const struct smbus_methods_t *methods;
struct smbus_methods_t *methods;
};
static const struct smbus_methods_t smbus_methods = {
@ -361,6 +361,7 @@ static acpi_status acpi_smbus_cmi_query_methods(acpi_handle handle, u32 level,
static int acpi_smbus_cmi_add(struct acpi_device *device)
{
struct acpi_smbus_cmi *smbus_cmi;
const struct acpi_device_id *id;
int ret;
smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL);
@ -368,7 +369,6 @@ static int acpi_smbus_cmi_add(struct acpi_device *device)
return -ENOMEM;
smbus_cmi->handle = device->handle;
smbus_cmi->methods = device_get_match_data(&device->dev);
strcpy(acpi_device_name(device), ACPI_SMBUS_HC_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_SMBUS_HC_CLASS);
device->driver_data = smbus_cmi;
@ -376,6 +376,11 @@ static int acpi_smbus_cmi_add(struct acpi_device *device)
smbus_cmi->cap_read = 0;
smbus_cmi->cap_write = 0;
for (id = acpi_smbus_cmi_ids; id->id[0]; id++)
if (!strcmp(id->id, acpi_device_hid(device)))
smbus_cmi->methods =
(struct smbus_methods_t *) id->driver_data;
acpi_walk_namespace(ACPI_TYPE_METHOD, smbus_cmi->handle, 1,
acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL);