From patchwork Sat Nov 4 21:24:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 10041801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5C89460567 for ; Sat, 4 Nov 2017 21:24:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F938293C9 for ; Sat, 4 Nov 2017 21:24:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 530AF29420; Sat, 4 Nov 2017 21:24:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 007BC293C9 for ; Sat, 4 Nov 2017 21:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752187AbdKDVYb (ORCPT ); Sat, 4 Nov 2017 17:24:31 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:50969 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbdKDVY2 (ORCPT ); Sat, 4 Nov 2017 17:24:28 -0400 Received: by mail-wr0-f195.google.com with SMTP id p96so5286040wrb.7; Sat, 04 Nov 2017 14:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nx5anEGcsSHAdbulEehnGuQEmH2tR8N2GKPQ4Dzit/g=; b=OKMHARLQwCVtaxndXv+cjT9/G0YUZZB/sJ+tTpRNqgZcT+HrJjJaUEY4biSzt2A2ZF txFZ0tsjtiwbOTU8qqa6WSn8WpQgQjGolEl4+ICpIbGlwAtWxf9hRC7GeH34Y9/PHXeY 7GB0lf8/7//F/tx6ZNjV3gHCyqgy8eiuwJLyeTnlXJQtOCPTF798hDncjUbmKgufdQpz nueYszlEa7i8qau23OdC429sQS0YHoOc9AWuld8V0+BJ/jgQljH+6Rx1nL79na2khM/d jnIhA3uA3QPyQV0DdxS8llJ1fFYGAard73yTvh5EXjIMj9UR4JKm3it/lcSAlXqsz2Nz 5POQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nx5anEGcsSHAdbulEehnGuQEmH2tR8N2GKPQ4Dzit/g=; b=UfqhAAG7G6h4N93DrLofaUV9n8rz1yH+eleg4rZfwBdSLEXt4DgXiSyu8tjLJNiTiA 6nHeBY6B6dSkOZLYKU8d7g96IWpXAp3twNk+Mv94/0MvUThsp2ByLJDIxxP3HREfeOUb Csax1Cz0glpB3n83s9fGU4NadBea2hm5qSTKevSUeZ8wHOQxGkPOY8ftiukZL2HCJst8 iyZgevEnxAU8LXzrSrJe446aPnTKqg0Sjn9Qf1rX6JxW9F5nBjl7oZpsZA8jnttfTmsi zbfvEVbIMlOd+DgpnQalXsrZ/IVbDUoS7E03C+sKBPvcjd32Qmjo4UpVyeCi+g2lnt/b bjyQ== X-Gm-Message-State: AJaThX7BfaahOYsouodz1HSlAeZCVQtpOYF6kq0RyPzOzlW3BGWZgpMI j+bvGFvWoZljIsHdQgXe3CA= X-Google-Smtp-Source: ABhQp+TJcUYDt5MG1JIn+rsRbb4M99P/HNSat+zgUKxy7leECay3b0Hz9JocWpqNpzFwS2hedAzSEg== X-Received: by 10.223.151.49 with SMTP id r46mr324815wrb.238.1509830667167; Sat, 04 Nov 2017 14:24:27 -0700 (PDT) Received: from localhost.localdomain (cpc101300-bagu16-2-0-cust362.1-3.cable.virginm.net. [86.21.41.107]) by smtp.gmail.com with ESMTPSA id c17sm11658353wrg.26.2017.11.04.14.24.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Nov 2017 14:24:26 -0700 (PDT) From: Sudip Mukherjee To: Bartlomiej Zolnierkiewicz Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, Sudip Mukherjee Subject: [PATCH 3/3] sm501fb: suspend and resume fb if it exists Date: Sat, 4 Nov 2017 21:24:21 +0000 Message-Id: <1509830661-7384-3-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1509830661-7384-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1509830661-7384-1-git-send-email-sudipm.mukherjee@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are cases when panel and crt both are not defined and only one of them is defined and initialized. In such cases, suspend or resume it only if it is defined. Signed-off-by: Sudip Mukherjee --- drivers/video/fbdev/sm501fb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 577a483..49233c1 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -2101,6 +2101,9 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info, struct fb_info *fbi = info->fb[head]; struct sm501fb_par *par = fbi->par; + if (!fbi) + return 0; + if (par->screen.size == 0) return 0; @@ -2148,6 +2151,9 @@ static void sm501fb_resume_fb(struct sm501fb_info *info, struct fb_info *fbi = info->fb[head]; struct sm501fb_par *par = fbi->par; + if (!fbi) + return; + if (par->screen.size == 0) return;