Merge tag 'qcom-drivers-for-6.15' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers
Qualcomm driver updates for v6.15 Improve the client interface for the Qualcomm ICE driver to avoid leaking references, including fixing the client drivers to call the new function. Adopt str_on_off() helper in AOSS driver and mark non-global servreg QMI element info array in the PDR driver static. * tag 'qcom-drivers-for-6.15' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: soc: qcom: Do not expose internal servreg_location_entry_ei array soc: qcom: ice: make of_qcom_ice_get() static scsi: ufs: qcom: fix dev reference leaked through of_qcom_ice_get mmc: sdhci-msm: fix dev reference leaked through of_qcom_ice_get soc: qcom: ice: introduce devm_of_qcom_ice_get dt-bindings: soc: qcom: qcom,pmic-glink: Document SM8750 compatible soc: qcom: Use str_enable_disable-like helpers Link: https://lore.kernel.org/r/20250317210158.2025380-1-andersson@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -38,6 +38,7 @@ properties:
|
||||
- items:
|
||||
- enum:
|
||||
- qcom,sm8650-pmic-glink
|
||||
- qcom,sm8750-pmic-glink
|
||||
- qcom,x1e80100-pmic-glink
|
||||
- const: qcom,sm8550-pmic-glink
|
||||
- const: qcom,pmic-glink
|
||||
|
||||
@@ -1873,7 +1873,7 @@ static int sdhci_msm_ice_init(struct sdhci_msm_host *msm_host,
|
||||
if (!(cqhci_readl(cq_host, CQHCI_CAP) & CQHCI_CAP_CS))
|
||||
return 0;
|
||||
|
||||
ice = of_qcom_ice_get(dev);
|
||||
ice = devm_of_qcom_ice_get(dev);
|
||||
if (ice == ERR_PTR(-EOPNOTSUPP)) {
|
||||
dev_warn(dev, "Disabling inline encryption support\n");
|
||||
ice = NULL;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_platform.h>
|
||||
@@ -261,7 +262,7 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
|
||||
* Return: ICE pointer on success, NULL if there is no ICE data provided by the
|
||||
* consumer or ERR_PTR() on error.
|
||||
*/
|
||||
struct qcom_ice *of_qcom_ice_get(struct device *dev)
|
||||
static struct qcom_ice *of_qcom_ice_get(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct qcom_ice *ice;
|
||||
@@ -322,7 +323,53 @@ struct qcom_ice *of_qcom_ice_get(struct device *dev)
|
||||
|
||||
return ice;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_qcom_ice_get);
|
||||
|
||||
static void qcom_ice_put(const struct qcom_ice *ice)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(ice->dev);
|
||||
|
||||
if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "ice"))
|
||||
platform_device_put(pdev);
|
||||
}
|
||||
|
||||
static void devm_of_qcom_ice_put(struct device *dev, void *res)
|
||||
{
|
||||
qcom_ice_put(*(struct qcom_ice **)res);
|
||||
}
|
||||
|
||||
/**
|
||||
* devm_of_qcom_ice_get() - Devres managed helper to get an ICE instance from
|
||||
* a DT node.
|
||||
* @dev: device pointer for the consumer device.
|
||||
*
|
||||
* This function will provide an ICE instance either by creating one for the
|
||||
* consumer device if its DT node provides the 'ice' reg range and the 'ice'
|
||||
* clock (for legacy DT style). On the other hand, if consumer provides a
|
||||
* phandle via 'qcom,ice' property to an ICE DT, the ICE instance will already
|
||||
* be created and so this function will return that instead.
|
||||
*
|
||||
* Return: ICE pointer on success, NULL if there is no ICE data provided by the
|
||||
* consumer or ERR_PTR() on error.
|
||||
*/
|
||||
struct qcom_ice *devm_of_qcom_ice_get(struct device *dev)
|
||||
{
|
||||
struct qcom_ice *ice, **dr;
|
||||
|
||||
dr = devres_alloc(devm_of_qcom_ice_put, sizeof(*dr), GFP_KERNEL);
|
||||
if (!dr)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
ice = of_qcom_ice_get(dev);
|
||||
if (!IS_ERR_OR_NULL(ice)) {
|
||||
*dr = ice;
|
||||
devres_add(dev, dr);
|
||||
} else {
|
||||
devres_free(dr);
|
||||
}
|
||||
|
||||
return ice;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_of_qcom_ice_get);
|
||||
|
||||
static int qcom_ice_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
||||
@@ -91,7 +91,6 @@ struct servreg_loc_pfr_resp {
|
||||
struct qmi_response_type_v01 rsp;
|
||||
};
|
||||
|
||||
extern const struct qmi_elem_info servreg_location_entry_ei[];
|
||||
extern const struct qmi_elem_info servreg_get_domain_list_req_ei[];
|
||||
extern const struct qmi_elem_info servreg_get_domain_list_resp_ei[];
|
||||
extern const struct qmi_elem_info servreg_register_listener_req_ei[];
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/thermal.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string_choices.h>
|
||||
#include <linux/soc/qcom/qcom_aoss.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
@@ -358,7 +359,7 @@ static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev,
|
||||
return 0;
|
||||
|
||||
ret = qmp_send(qmp_cdev->qmp, "{class: volt_flr, event:zero_temp, res:%s, value:%s}",
|
||||
qmp_cdev->name, cdev_state ? "on" : "off");
|
||||
qmp_cdev->name, str_on_off(cdev_state));
|
||||
if (!ret)
|
||||
qmp_cdev->state = cdev_state;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "pdr_internal.h"
|
||||
|
||||
const struct qmi_elem_info servreg_location_entry_ei[] = {
|
||||
static const struct qmi_elem_info servreg_location_entry_ei[] = {
|
||||
{
|
||||
.data_type = QMI_STRING,
|
||||
.elem_len = SERVREG_NAME_LENGTH + 1,
|
||||
@@ -47,7 +47,6 @@ const struct qmi_elem_info servreg_location_entry_ei[] = {
|
||||
},
|
||||
{}
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(servreg_location_entry_ei);
|
||||
|
||||
const struct qmi_elem_info servreg_get_domain_list_req_ei[] = {
|
||||
{
|
||||
|
||||
@@ -125,7 +125,7 @@ static int ufs_qcom_ice_init(struct ufs_qcom_host *host)
|
||||
int err;
|
||||
int i;
|
||||
|
||||
ice = of_qcom_ice_get(dev);
|
||||
ice = devm_of_qcom_ice_get(dev);
|
||||
if (ice == ERR_PTR(-EOPNOTSUPP)) {
|
||||
dev_warn(dev, "Disabling inline encryption support\n");
|
||||
ice = NULL;
|
||||
|
||||
@@ -33,5 +33,6 @@ int qcom_ice_program_key(struct qcom_ice *ice,
|
||||
const u8 crypto_key[], u8 data_unit_size,
|
||||
int slot);
|
||||
int qcom_ice_evict_key(struct qcom_ice *ice, int slot);
|
||||
struct qcom_ice *of_qcom_ice_get(struct device *dev);
|
||||
struct qcom_ice *devm_of_qcom_ice_get(struct device *dev);
|
||||
|
||||
#endif /* __QCOM_ICE_H__ */
|
||||
|
||||
Reference in New Issue
Block a user