From: Arnd Bergmann <arnd@arndb.de>
To: Imran Khan <kimran@codeaurora.org>
Cc: andy.gross@linaro.org, David Brown <david.brown@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@vger.kernel.org>,
"open list:ARM/QUALCOMM SUPPORT" <linux-soc@vger.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] soc: qcom: Add SoC info driver
Date: Fri, 21 Oct 2016 12:33:40 +0200 [thread overview]
Message-ID: <2349770.MVMXr64OoI@wuerfel> (raw)
In-Reply-To: <1476972386-28655-1-git-send-email-kimran@codeaurora.org>
On Thursday, October 20, 2016 7:36:22 PM CEST Imran Khan wrote:
> +#include <linux/soc/qcom/socinfo.h>
> +#include <linux/soc/qcom/smem.h>
> +
> +#include <asm/system_misc.h>
I don't see anything here that needs asm/system_misc.h
> +const char *hw_platform[] = {
> + [HW_PLATFORM_UNKNOWN] = "Unknown",
> + [HW_PLATFORM_SURF] = "Surf",
> + [HW_PLATFORM_FFA] = "FFA",
> + [HW_PLATFORM_FLUID] = "Fluid",
> +};
> +
> +const char *qrd_hw_platform_subtype[] = {
> + [PLATFORM_SUBTYPE_QRD] = "QRD",
> + [PLATFORM_SUBTYPE_SKUAA] = "SKUAA",
> +};
> +
> +const char *hw_platform_subtype[] = {
> + [PLATFORM_SUBTYPE_UNKNOWN] = "Unknown",
> +};
Make these all static
> +
> +/* Used to parse shared memory. Must match the modem. */
> +struct socinfo_v0_1 {
> + uint32_t format;
> + uint32_t id;
> + uint32_t version;
s/uint32_t/u32/
> +
> +uint32_t socinfo_get_id(void)
> +{
> + return (socinfo) ? socinfo->v0_1.id : 0;
> +}
> +EXPORT_SYMBOL_GPL(socinfo_get_id);
> +
> +uint32_t socinfo_get_version(void)
> +{
> + return (socinfo) ? socinfo->v0_1.version : 0;
> +}
> +EXPORT_SYMBOL_GPL(socinfo_get_version);
> +
> +char *socinfo_get_build_id(void)
> +{
> + return (socinfo) ? socinfo->v0_1.build_id : NULL;
> +}
> +EXPORT_SYMBOL_GPL(socinfo_get_build_id);
Please remove all the exports and mark the functions static,
we don't want any drivers poking vendor-specific interfaces
for this.
> +/* socinfo: sysfs functions */
This seems overly verbose, having both raw and human-readable
IDs is generally not necessary, pick one of the two. If you
need any fields that we don't already support in soc_device,
let's talk about adding them to the generic structure.
> +static ssize_t
> +qcom_get_image_version(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + char *string_address;
> +
> + string_address = socinfo_get_image_version_base_address(dev);
> + if (IS_ERR_OR_NULL(string_address)) {
IS_ERR_OR_NULL() indicates that your interface is not well-designed.
Please return either NULL on all failures, or return an error pointer
on all failures, not both.
> +/* Platform Subtype String is being deprecated. Use Platform
> + * Subtype ID instead.
> + */
If it's deprecated, don't add it to the kernel!
> diff --git a/include/linux/soc/qcom/socinfo.h b/include/linux/soc/qcom/socinfo.h
> new file mode 100644
> index 0000000..17ca50a
> --- /dev/null
> +++ b/include/linux/soc/qcom/socinfo.h
Merge the header file into the driver.
Arnd
next prev parent reply other threads:[~2016-10-21 10:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 14:06 [PATCH] soc: qcom: Add SoC info driver Imran Khan
2016-10-20 14:09 ` Mark Rutland
2016-10-20 15:20 ` Andy Gross
2016-10-25 9:38 ` Imran Khan
2016-10-21 10:33 ` Arnd Bergmann [this message]
2016-10-25 9:53 ` Imran Khan
2016-10-25 20:49 ` Arnd Bergmann
2016-10-26 13:50 ` Imran Khan
2016-10-26 14:05 ` Arnd Bergmann
2016-10-26 14:12 ` Imran Khan
2016-10-26 14:46 ` Arnd Bergmann
2016-10-27 13:10 ` Imran Khan
2016-10-27 13:41 ` Arnd Bergmann
2016-11-02 7:49 ` Imran Khan
2016-11-02 13:11 ` Arnd Bergmann
2016-11-02 16:28 ` Bjorn Andersson
2016-11-09 14:44 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2349770.MVMXr64OoI@wuerfel \
--to=arnd@arndb.de \
--cc=andy.gross@linaro.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=kimran@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox