summaryrefslogtreecommitdiff
path: root/backport/compat
diff options
context:
space:
mode:
Diffstat (limited to 'backport/compat')
-rw-r--r--backport/compat/backport-3.17.c18
-rw-r--r--backport/compat/backport-4.12.c2
-rw-r--r--backport/compat/compat-3.5.c4
-rw-r--r--backport/compat/compat-3.6.c2
-rw-r--r--backport/compat/compat-3.7.c3
-rw-r--r--backport/compat/compat-3.8.c3
6 files changed, 30 insertions, 2 deletions
diff --git a/backport/compat/backport-3.17.c b/backport/compat/backport-3.17.c
index bf6027cb..5961e3bc 100644
--- a/backport/compat/backport-3.17.c
+++ b/backport/compat/backport-3.17.c
@@ -146,6 +146,24 @@ char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...)
}
EXPORT_SYMBOL_GPL(devm_kasprintf);
+u64 bp_ktime_divns(const ktime_t kt, s64 div)
+{
+ u64 dclc;
+ int sft = 0;
+
+ dclc = ktime_to_ns(kt);
+ /* Make sure the divisor is less than 2^32: */
+ while (div >> 32) {
+ sft++;
+ div >>= 1;
+ }
+ dclc >>= sft;
+ do_div(dclc, (unsigned long) div);
+
+ return dclc;
+}
+EXPORT_SYMBOL_GPL(bp_ktime_divns);
+
#define STANDARD_PARAM_DEF(name, type, format, strtolfn) \
int param_set_##name(const char *val, const struct kernel_param *kp) \
{ \
diff --git a/backport/compat/backport-4.12.c b/backport/compat/backport-4.12.c
index 413ae7f1..4f9de261 100644
--- a/backport/compat/backport-4.12.c
+++ b/backport/compat/backport-4.12.c
@@ -3,6 +3,7 @@
#endif
#ifdef CONFIG_OF
+#if LINUX_VERSION_IS_GEQ(4,4,0)
/**
* of_device_modalias - Fill buffer with newline terminated modalias string
*/
@@ -20,3 +21,4 @@ ssize_t bp_of_device_modalias(struct device *dev, char *str, ssize_t len)
}
EXPORT_SYMBOL_GPL(bp_of_device_modalias);
#endif
+#endif
diff --git a/backport/compat/compat-3.5.c b/backport/compat/compat-3.5.c
index de312283..721ec0e3 100644
--- a/backport/compat/compat-3.5.c
+++ b/backport/compat/compat-3.5.c
@@ -67,7 +67,9 @@ EXPORT_SYMBOL_GPL(overflowuid);
EXPORT_SYMBOL_GPL(overflowgid);
#endif
-#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
+/* #if IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
+/* backported to all of our kernels */
+#if 0
int ptp_clock_index(struct ptp_clock *ptp)
{
return ptp->index;
diff --git a/backport/compat/compat-3.6.c b/backport/compat/compat-3.6.c
index ef364852..9e593f5c 100644
--- a/backport/compat/compat-3.6.c
+++ b/backport/compat/compat-3.6.c
@@ -14,6 +14,7 @@
/* whoopsie ! */
#ifndef CONFIG_COMMON_CLK
+#ifndef CONFIG_ARCH_TEGRA
int clk_enable(struct clk *clk)
{
return 0;
@@ -25,3 +26,4 @@ void clk_disable(struct clk *clk)
}
EXPORT_SYMBOL_GPL(clk_disable);
#endif
+#endif
diff --git a/backport/compat/compat-3.7.c b/backport/compat/compat-3.7.c
index a70709c9..528d7ec9 100644
--- a/backport/compat/compat-3.7.c
+++ b/backport/compat/compat-3.7.c
@@ -49,10 +49,11 @@ static inline u16 pcie_flags_reg(struct pci_dev *dev)
}
#define pci_pcie_type LINUX_BACKPORT(pci_pcie_type)
-static inline int pci_pcie_type(struct pci_dev *dev)
+int pci_pcie_type(struct pci_dev *dev)
{
return (pcie_flags_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
}
+EXPORT_SYMBOL_GPL(pci_pcie_type);
#define pcie_cap_version LINUX_BACKPORT(pcie_cap_version)
static inline int pcie_cap_version(struct pci_dev *dev)
diff --git a/backport/compat/compat-3.8.c b/backport/compat/compat-3.8.c
index ff9cd493..21686cc3 100644
--- a/backport/compat/compat-3.8.c
+++ b/backport/compat/compat-3.8.c
@@ -356,6 +356,8 @@ bool hid_ignore(struct hid_device *hdev)
}
EXPORT_SYMBOL_GPL(hid_ignore);
+/* backported to our kernel */
+#if 0
/**
* prandom_bytes - get the requested number of pseudo-random bytes
* @buf: where to copy the pseudo-random bytes to
@@ -386,6 +388,7 @@ void prandom_bytes(void *buf, int bytes)
}
}
EXPORT_SYMBOL_GPL(prandom_bytes);
+#endif
#ifdef CONFIG_OF
/**