From patchwork Tue Mar 10 08:45:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 5975641 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 000AFBF440 for ; Tue, 10 Mar 2015 08:47:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 174892017D for ; Tue, 10 Mar 2015 08:47:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B8162012E for ; Tue, 10 Mar 2015 08:47:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751574AbbCJIq4 (ORCPT ); Tue, 10 Mar 2015 04:46:56 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:33699 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752648AbbCJIqU (ORCPT ); Tue, 10 Mar 2015 04:46:20 -0400 Received: by pdev10 with SMTP id v10so191176pde.0; Tue, 10 Mar 2015 01:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=m4DR98eu+CP2qs3mKNTaO5B76saZWklp1+4NO7EPbds=; b=eAO8EEnN80ol1ujWYyHjwiWO9COa5ZWxAavWCLAPt33devG8s4iCxInHbBYLB3rZy7 c63gcg4zfcDDtH8qrUihiFsn9RAkdxz83d026vFpPkZuYWxFg7S3dfgNvDRYXh6cxt88 kH6tWuQ2Ngja26iPs7VC0MJIrg5UpI2i6BGt9upnm8c7C33vTE3djY0jKLhwZuE//nEc ti8I3Lj8qVTveYGG6/shLUuFtUX0hgvXm2LSnG894bcQGD2T2OuYvoH9dAZQhU2g63yx ZQStmmRvDSb4HsZ8p3+gFnN/KVxfxSZ/vb77l2P5Il5cqU5u+RWA0J7yJxGAmPsjecRo nrCw== X-Received: by 10.66.154.17 with SMTP id vk17mr62898671pab.5.1425977180444; Tue, 10 Mar 2015 01:46:20 -0700 (PDT) Received: from localhost.localdomain ([122.169.145.94]) by mx.google.com with ESMTPSA id v2sm22937994pdm.77.2015.03.10.01.46.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Mar 2015 01:46:19 -0700 (PDT) From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [PATCH v3 4/5] staging: sm750fb: fix undeclared function Date: Tue, 10 Mar 2015 14:15:38 +0530 Message-Id: <1425977139-25285-4-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1425977139-25285-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1425977139-25285-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-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP kbuild test robot reported that for microblaze-allyesconfig chan_to_field() and lynxfb_ops_set_par() were not defined. These two functions were defined under CONFIG_PM, so for any archtecture if CONFIG_PM is not defined we will have this error. while moving the lynxfb_suspend() function some very obvious checkpatch errors, like space after comma, space after if, space before opening brace, were taken care of. Reported-by: kbuild test robot Signed-off-by: Sudip Mukherjee --- v3: no change v2: some extra spaces in the comments were removed. drivers/staging/sm750fb/sm750.c | 110 +++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 57 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 753869e..476dc5c 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -303,62 +303,6 @@ static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var, return ret; } - - - -#ifdef CONFIG_PM -static int lynxfb_suspend(struct pci_dev * pdev,pm_message_t mesg) -{ - struct fb_info * info; - struct lynx_share * share; - int ret; - - - if(mesg.event == pdev->dev.power.power_state.event) - return 0; - - ret = 0; - share = pci_get_drvdata(pdev); - switch (mesg.event) { - case PM_EVENT_FREEZE: - case PM_EVENT_PRETHAW: - pdev->dev.power.power_state = mesg; - return 0; - } - - console_lock(); - if (mesg.event & PM_EVENT_SLEEP) { - info = share->fbinfo[0]; - if(info) - fb_set_suspend(info, 1);/* 1 means do suspend*/ - - info = share->fbinfo[1]; - if(info) - fb_set_suspend(info, 1);/* 1 means do suspend*/ - - ret = pci_save_state(pdev); - if(ret){ - pr_err("error:%d occured in pci_save_state\n",ret); - return ret; - } - - /* set chip to sleep mode */ - if(share->suspend) - (*share->suspend)(share); - - pci_disable_device(pdev); - ret = pci_set_power_state(pdev,pci_choose_state(pdev,mesg)); - if(ret){ - pr_err("error:%d occured in pci_set_power_state\n",ret); - return ret; - } - } - - pdev->dev.power.power_state = mesg; - console_unlock(); - return ret; -} - static int lynxfb_ops_set_par(struct fb_info * info) { struct lynxfb_par * par; @@ -369,7 +313,6 @@ static int lynxfb_ops_set_par(struct fb_info * info) struct fb_fix_screeninfo * fix; int ret; unsigned int line_length; - if(!info) return -EINVAL; @@ -441,6 +384,7 @@ static int lynxfb_ops_set_par(struct fb_info * info) ret = output->proc_setMode(output,var,fix); return ret; } + static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield * bf) { chan &= 0xffff; @@ -448,6 +392,58 @@ static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield * return chan << bf->offset; } +#ifdef CONFIG_PM +static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg) +{ + struct fb_info *info; + struct lynx_share *share; + int ret; + + if (mesg.event == pdev->dev.power.power_state.event) + return 0; + + ret = 0; + share = pci_get_drvdata(pdev); + switch (mesg.event) { + case PM_EVENT_FREEZE: + case PM_EVENT_PRETHAW: + pdev->dev.power.power_state = mesg; + return 0; + } + + console_lock(); + if (mesg.event & PM_EVENT_SLEEP) { + info = share->fbinfo[0]; + if (info) + /* 1 means do suspend*/ + fb_set_suspend(info, 1); + info = share->fbinfo[1]; + if (info) + /* 1 means do suspend*/ + fb_set_suspend(info, 1); + + ret = pci_save_state(pdev); + if (ret) { + pr_err("error:%d occurred in pci_save_state\n", ret); + return ret; + } + + /* set chip to sleep mode*/ + if (share->suspend) + (*share->suspend)(share); + + pci_disable_device(pdev); + ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg)); + if (ret) { + pr_err("error:%d occurred in pci_set_power_state\n", ret); + return ret; + } + } + + pdev->dev.power.power_state = mesg; + console_unlock(); + return ret; +} static int lynxfb_resume(struct pci_dev* pdev) {