From patchwork Tue Nov 1 15:09:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13742 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3045481wru; Tue, 1 Nov 2022 08:38:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5OPr4K+pPW8VTTEjDjRR1fKgrcol8uYBRSUAvF5srVtdqL7xbvvTX9U5ambJDg20gyBZXy X-Received: by 2002:a17:90b:1c11:b0:213:2253:fa7a with SMTP id oc17-20020a17090b1c1100b002132253fa7amr21350315pjb.111.1667317135859; Tue, 01 Nov 2022 08:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667317135; cv=none; d=google.com; s=arc-20160816; b=pzqcDwxjBLrU8xJs2q0ZgfqoHeufCmnUfrXZtrveYckL2oB8vRT0Yasa+r+CK5eac7 oUBgF2Amc8030yNl6ZCc7yF5533CBcDhcKgH1UILm+LRvzwvyG4kPhkeb4ko9tUvYsJB TaPcHL4j/bBh9fhtd2LTHtIuAxO2rN4zSmfLqjuvymfiG//fE9uKTIwOXXIVB7GDiHQY tXg/K56ZAzM/D+RoLWkcsKyQApUi5/PSH9iNMJuyXAfXdW39ljMb7nY0wSDX9BlJbOsq xy10YARXjnEOux9N6zL6Vze1iosCRgAtnqZU/e32nvAH9vg/hQFpDUTYO+AAxN5V9Av1 JHQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nYKAy0U/gfxypgJYEMbdxdgbKfJGbuAEn4+lmayd+o4=; b=Jd/wplYWtHjj3A3EzAd5PV7O0IrqQPTXkM1CdEl+PJAAsqW3TmI8UyOF6mXypeb9kH sZTDkRPuzIU+CL0H++zgwsl2u5BzqESt5g0ysAHeGUNZLBaq73XKfcwBQ/ec0y7oXwxi UB8qIzLAyjonOXETCSAhGKvL3D6QQkRLzvRRQHuwVfMx2loBXk8DTy7fzcqsovfIzePP z0DlV2FYlPnbcjAUzoAYEFWqN2GhNhtfL+NqS6SNJhCPQAz0ywTe2YjAHuXZMac5Oi1Z B4IqUdDGylGZPRcdewk+h162WMy8lCMDbX8dE0hp2yPqIyju2CMjYbF3xCZR4ZjLQy85 NTSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MUkxF3f5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170902eb9000b0017f59ed2dfasi12320467plg.63.2022.11.01.08.38.42; Tue, 01 Nov 2022 08:38:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MUkxF3f5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230127AbiKAPOS (ORCPT + 99 others); Tue, 1 Nov 2022 11:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231166AbiKAPN5 (ORCPT ); Tue, 1 Nov 2022 11:13:57 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C2631EC5E; Tue, 1 Nov 2022 08:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667315374; x=1698851374; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=s75q2MsgxsQuSoRbKCZULbXrGHbPl+xDbnix/pI6B6E=; b=MUkxF3f57Xvt82P/+U5quBLfEzT08ERs6YDzNbxKxNLWbRZK6Q8TrCzE 5MScQqT4NJj7/dYyXhisP4nIvCpWA+CgCq+8JaxIG99Z7vsrPgj+Wm7RK psQEcreM3fVXMaAd8RpVxn+pw0eJyP8uHyOaWxSHyF6xMVF9Dink7Qad0 kfHX96WOTUuJ1LGKl2UCGkbTw1UQqBAbF7KexGf31r8aksFCmbTDOZVtJ rYW8sg1xe1v6KFidp0dI9ujWAuTn8RLt8gG/sL0yuQsfe4jjbLhnNE6T2 qsQotO+NfRv0kY8oNofber+/bn055/ZFwp2yZDaZs2DnY8caOZaC+YTSc g==; X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="395468737" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="395468737" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 08:09:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="667221094" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="667221094" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 01 Nov 2022 08:09:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5620DF7; Tue, 1 Nov 2022 17:09:52 +0200 (EET) From: Andy Shevchenko To: Javier Martinez Canillas , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Helge Deller , Andy Shevchenko Subject: [PATCH v1 1/2] fbdev: ssd1307fb: Drop optional dependency Date: Tue, 1 Nov 2022 17:09:46 +0200 Message-Id: <20221101150947.67377-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748308732729616846?= X-GMAIL-MSGID: =?utf-8?q?1748308732729616846?= Only a single out of three devices need a PWM, so from driver it's optional. Moreover it's a single driver in the entire kernel that currently selects PWM. Unfortunately this selection is a root cause of the circular dependencies when we want to enable optional PWM for some other drivers that select GPIOLIB. Fixes: a2ed00da5047 ("drivers/video: add support for the Solomon SSD1307 OLED Controller") Signed-off-by: Andy Shevchenko --- drivers/video/fbdev/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index a98987aa2784..b88d8bfe992e 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -2218,7 +2218,6 @@ config FB_SSD1307 select FB_SYS_COPYAREA select FB_SYS_IMAGEBLIT select FB_DEFERRED_IO - select PWM select FB_BACKLIGHT help This driver implements support for the Solomon SSD1307 From patchwork Tue Nov 1 15:09:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13741 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3045096wru; Tue, 1 Nov 2022 08:38:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mOear+xEggslMo4HRxYRj6M2jDgYEqJeoJs2XU/Nm3C1pbH0RGSe7JGVZES4OKrU87kF3 X-Received: by 2002:a17:907:75f1:b0:78a:f935:647d with SMTP id jz17-20020a17090775f100b0078af935647dmr18622306ejc.587.1667317087304; Tue, 01 Nov 2022 08:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667317087; cv=none; d=google.com; s=arc-20160816; b=urv4Oa2+1oeS8XOXz2JYir8GRydsi8EbyviKfKPVirMDtoponNns4aNE1Xnj0AKSZv Ufpzi6/u7Gy4wQtDCig/Hpfwl3n6sq2GHTBamwZ0PWZCVjQ0DV7qq00iWZbNpN+qqOVR +r+6vSSlidAt8ZLC94Vd2X77v/eUI5HP0DoofkUz8t0Ddv62kU4eydrnOqK/lmKi4J4l Gwj/wryONq3FMhaSwP9bCb4sn0NFiOrvk5iY44ApNcbbhKkjyPkCl0RzxoAQaT1TLKZ7 WSasvdyvEJYTAq8F0kkYLQk3P0ZqF09NqeNagaz34txX1HkKXcT8tHMt/aiT0h9z9fMR v82w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dTwh+Ec3mpjfQAF+/co1fD0f7saD42YeL4F9lt6GRJg=; b=ymqipaSF06on6i58iBd+PASYMqiNwTIV/g8ZeexZ4MYISjalI0QC7kEUbjVQxtTvCA M3QVgpPjGbKbo4gE4EHHeppcvl0XoNxn3Mr9J3SWTWDkAlKJ/wduyWHB/EeJ0vzbOdCQ nktBB+kW26L8plTQaMM/C/SysbJHlDDC6GJUeF9p42cmz5EKJLeaUpkdiPGveYuyKfC1 QZGSqOetQMiSsTnlcR4cU5sHi4Qi3VpvScY1jJklcNx/zkQqwhGW5vAT+IcPA4OwYxCL bEBCChOd8q0qoCveeCcuBhmbPC/3DdRJQ09qEgfdnnKjFCWIdxgYRmzqlyMffxCEJ1cb Ucpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MjqRdx90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a056402190e00b004635dccd3casi8931344edz.57.2022.11.01.08.37.43; Tue, 01 Nov 2022 08:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MjqRdx90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbiKAPON (ORCPT + 99 others); Tue, 1 Nov 2022 11:14:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbiKAPNz (ORCPT ); Tue, 1 Nov 2022 11:13:55 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B35A1F9FB; Tue, 1 Nov 2022 08:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667315371; x=1698851371; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ak/4T+4EA30gwIfd/EobbLy7FhELRXx6beNhV222/eY=; b=MjqRdx90Blmf/E8VlqBSK5+63Ko/vsPuSuOK8b07rhYzK7j4Sldql67u q9lzSxTJz7TEEMwyyoCO1ytVe4t93djNiV17mB7EtIZLQaq/2s2JJ/n6j 9zXistURKbCoqyazR3vkat1bS5CCkBfD3AlbFRAjHsWzFVHqZz3yM5shL dyXMbvYzhesHdwD7cX8enBPsAXEauu+Sr/6k20p+P6NOU89lWRliXAtc8 hvc1tf8J4DSx8KCGgBMlVX1ZITdu74+9ZHDNcA8xBJibS8REGF+c9q2iE vDXPIaX4Xn6niBaEjaScAHVZLjnLI70gEjzUvpyXSd1tkbMl7IWzbKGaa g==; X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="395468736" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="395468736" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 08:09:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="667221091" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="667221091" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 01 Nov 2022 08:09:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 61770D0; Tue, 1 Nov 2022 17:09:52 +0200 (EET) From: Andy Shevchenko To: Javier Martinez Canillas , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Helge Deller , Andy Shevchenko Subject: [PATCH v1 2/2] fbdev: ssd1307fb: Drop duplicate NULL checks for PWM APIs Date: Tue, 1 Nov 2022 17:09:47 +0200 Message-Id: <20221101150947.67377-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221101150947.67377-1-andriy.shevchenko@linux.intel.com> References: <20221101150947.67377-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748308682104823605?= X-GMAIL-MSGID: =?utf-8?q?1748308682104823605?= pwm_disable() and pwm_put() are NULL-aware, no need to duplicate the check in the caller. Signed-off-by: Andy Shevchenko --- drivers/video/fbdev/ssd1307fb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 5c891aa00d59..046b9990d27c 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -803,10 +803,8 @@ static int ssd1307fb_probe(struct i2c_client *client) bl_init_error: unregister_framebuffer(info); panel_init_error: - if (par->device_info->need_pwm) { - pwm_disable(par->pwm); - pwm_put(par->pwm); - } + pwm_disable(par->pwm); + pwm_put(par->pwm); regulator_enable_error: if (par->vbat_reg) regulator_disable(par->vbat_reg); @@ -827,10 +825,8 @@ static void ssd1307fb_remove(struct i2c_client *client) backlight_device_unregister(info->bl_dev); unregister_framebuffer(info); - if (par->device_info->need_pwm) { - pwm_disable(par->pwm); - pwm_put(par->pwm); - } + pwm_disable(par->pwm); + pwm_put(par->pwm); if (par->vbat_reg) regulator_disable(par->vbat_reg); fb_deferred_io_cleanup(info);