Skip to content

Commit 6b4bc14

Browse files
Hans de Goedeij-intel
authored andcommitted
platform/x86: x86-android-tablets: Simplify lenovo_yoga_tab2_830_1050_exit()
lenovo_yoga_tab2_830_1050_exit() only gets called after a successful lenovo_yoga_tab2_830_1050_init() call so there is no need to check if lenovo_yoga_tab2_830_1050_codec_[dev|pinctrl] are set. Also change the exit() order to be the exact reverse of init(). Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Hans de Goede <hansg@kernel.org> Link: https://patch.msgid.link/20250920200713.20193-19-hansg@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 6564d3e commit 6b4bc14

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

  • drivers/platform/x86/x86-android-tablets

drivers/platform/x86/x86-android-tablets/lenovo.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -594,15 +594,10 @@ static void lenovo_yoga_tab2_830_1050_exit(void)
594594
{
595595
unregister_sys_off_handler(lenovo_yoga_tab2_830_1050_sys_off_handler);
596596

597-
if (lenovo_yoga_tab2_830_1050_codec_dev) {
598-
device_remove_software_node(lenovo_yoga_tab2_830_1050_codec_dev);
599-
put_device(lenovo_yoga_tab2_830_1050_codec_dev);
600-
}
601-
602-
if (lenovo_yoga_tab2_830_1050_codec_pinctrl) {
603-
pinctrl_put(lenovo_yoga_tab2_830_1050_codec_pinctrl);
604-
pinctrl_unregister_mappings(&lenovo_yoga_tab2_830_1050_codec_pinctrl_map);
605-
}
597+
device_remove_software_node(lenovo_yoga_tab2_830_1050_codec_dev);
598+
pinctrl_put(lenovo_yoga_tab2_830_1050_codec_pinctrl);
599+
pinctrl_unregister_mappings(&lenovo_yoga_tab2_830_1050_codec_pinctrl_map);
600+
put_device(lenovo_yoga_tab2_830_1050_codec_dev);
606601
}
607602

608603
/*

0 commit comments

Comments
 (0)