From patchwork Tue Sep 11 06:04:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 11289 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9BC5E23E02 for ; Tue, 11 Sep 2012 06:07:27 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4B8C8A18B4F for ; Tue, 11 Sep 2012 06:07:27 +0000 (UTC) Received: by ieak11 with SMTP id k11so287753iea.11 for ; Mon, 10 Sep 2012 23:07:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=QAdeg2vO9mH+YNFr0rsW+rrFKyTAkvzGHnFfuXkYMGM=; b=R4p/9XI6rEIVKbj0kfIynqJqWKdEIYS9wDx6QUjm/l33SpDt1bgOzOhS0uSwXO1UYV A/aBBSc4oh9G1CFllSQVx1UZCCM5TTG+eeneJ5RkQz92/0F+V7t7fDKaBTTexXoapl+3 /9O4gWhgXUUG4eiJe0JT+CjO2EmwrfQOwi9077x+7vjI7M74Fwss3WnVUFSBSLUhpAom QNBfStvB7Z8AR+6bkIl91QsDOsZExyNYJObK2RqjBuC/mOvpi0C51eC2UeX4Z9Xz6jdZ axkVbk4gp75zLY9yG98PrnEFRxpTLoXf1ereYbQ7Zi0GDbAL4leW1eHV1I77EQaDSoq9 nR+g== Received: by 10.50.242.3 with SMTP id wm3mr14293982igc.0.1347343646760; Mon, 10 Sep 2012 23:07:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp134973igc; Mon, 10 Sep 2012 23:07:26 -0700 (PDT) Received: by 10.68.129.38 with SMTP id nt6mr10000204pbb.76.1347343645536; Mon, 10 Sep 2012 23:07:25 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id px6si23517778pbc.214.2012.09.10.23.07.25 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Sep 2012 23:07:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by dade7 with SMTP id e7so122524dad.37 for ; Mon, 10 Sep 2012 23:07:25 -0700 (PDT) Received: by 10.68.136.102 with SMTP id pz6mr9823157pbb.160.1347343645010; Mon, 10 Sep 2012 23:07:25 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id it5sm3087173pbc.10.2012.09.10.23.07.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Sep 2012 23:07:24 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: thierry.reding@avionic-design.de, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH] pwm: Fix compilation error when CONFIG_PWM is not defined Date: Tue, 11 Sep 2012 11:34:24 +0530 Message-Id: <1347343464-15417-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmmxCrywfkmUYYrpJ3igEbRKaRCatDsgc34ta7eVF26v0rwONTHnFALdIBu+PlPp7xldU1b As per Documentation/pwm.txt, PWM_LOOKUP and pwm_add_table are used in board support files to add PWM chip entries. Currently these definitions are protected within CONFIG_PWM macro in include/linux/pwm.h. Otherwise, we have to add ifdef's in machine file to fix following compilation error. error: array type has incomplete element type error: implicit declaration of function ‘PWM_LOOKUP’ [-Werror=implicit-function-declaration] error: implicit declaration of function ‘pwm_add_table’ [-Werror=implicit-function-declaration] error: bit-field ‘’ width not an integer constant Reported-by: Sachin Kamat Signed-off-by: Tushar Behera --- include/linux/pwm.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 21d076c..87e7f45 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -124,6 +124,7 @@ struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip, struct pwm_device *pwm_get(struct device *dev, const char *consumer); void pwm_put(struct pwm_device *pwm); +#endif struct pwm_lookup { struct list_head list; @@ -141,8 +142,10 @@ struct pwm_lookup { .con_id = _con_id, \ } +#ifdef CONFIG_PWM void pwm_add_table(struct pwm_lookup *table, size_t num); - +#else +static void pwm_add_table(struct pwm_lookup *table, size_t num) {} #endif #endif /* __LINUX_PWM_H */